hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7fe5cc57b8dc3dbda90bbec12570fac6442abf1 | 778,605 | py | Python | test/unit/test_cloudant_v1.py | IBM/cloudant-python-sdk | e5c6dfb7a0b932025e3249dece60658e390a4e8d | [
"Apache-2.0"
] | 19 | 2020-11-10T13:50:54.000Z | 2022-03-28T03:35:53.000Z | test/unit/test_cloudant_v1.py | IBM/cloudant-python-sdk | e5c6dfb7a0b932025e3249dece60658e390a4e8d | [
"Apache-2.0"
] | 129 | 2020-08-19T14:20:18.000Z | 2022-03-31T07:39:30.000Z | test/unit/test_cloudant_v1.py | IBM/cloudant-python-sdk | e5c6dfb7a0b932025e3249dece60658e390a4e8d | [
"Apache-2.0"
] | 5 | 2020-06-29T15:25:41.000Z | 2021-08-16T23:33:35.000Z | # -*- coding: utf-8 -*-
# (C) Copyright IBM Corp. 2021.
#
# 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 l... | 41.556629 | 1,470 | 0.647074 |
from datetime import datetime, timezone
from ibm_cloud_sdk_core.authenticators.no_auth_authenticator import NoAuthAuthenticator
from ibm_cloud_sdk_core.utils import datetime_to_string, string_to_datetime
import base64
import inspect
import io
import json
import os
import pytest
import re
import requests... | true | true |
f7fe5ce54a5974d8e0a1765d3a0ffae24c2b3014 | 352 | py | Python | galaa/migrations/0002_rename_image_name_photos_name.py | lizgi/photo-gala | 67647314577afbf9174ab715be32ac86047f8fb0 | [
"MIT"
] | null | null | null | galaa/migrations/0002_rename_image_name_photos_name.py | lizgi/photo-gala | 67647314577afbf9174ab715be32ac86047f8fb0 | [
"MIT"
] | null | null | null | galaa/migrations/0002_rename_image_name_photos_name.py | lizgi/photo-gala | 67647314577afbf9174ab715be32ac86047f8fb0 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-11-26 22:19
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('galaa', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='photos',
old_name='image_name',
ne... | 18.526316 | 47 | 0.571023 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('galaa', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='photos',
old_name='image_name',
new_name='name',
),
]
| true | true |
f7fe5cfdd9ca84f74da4f55e7e6ee327870acbad | 3,091 | py | Python | airbyte-integrations/connectors/source-chargebee/source_chargebee/source.py | jinnig/airbyte | 1ccd21867b7908380b941ac4aa7737b59d18d4a9 | [
"MIT"
] | 2 | 2021-08-04T03:17:38.000Z | 2021-11-15T10:16:08.000Z | airbyte-integrations/connectors/source-chargebee/source_chargebee/source.py | jinnig/airbyte | 1ccd21867b7908380b941ac4aa7737b59d18d4a9 | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-chargebee/source_chargebee/source.py | jinnig/airbyte | 1ccd21867b7908380b941ac4aa7737b59d18d4a9 | [
"MIT"
] | 1 | 2021-08-04T03:25:02.000Z | 2021-08-04T03:25:02.000Z | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | 42.342466 | 131 | 0.703656 |
from typing import Any, List, Mapping, Tuple
import chargebee
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from .streams import Addon, Customer, Invoice, Order, Plan, Subscription
class SourceChargebee(A... | true | true |
f7fe5d2291f6b08338083a0d398fa1269dbe65cf | 220 | py | Python | playground_env/.playground/connectors/passthrough/__init__.py | kandarpck/networksecurity2018 | dafe2ee8d39bd9596b1ce3fbc8b50ca645bcd626 | [
"MIT"
] | 3 | 2018-10-25T16:03:53.000Z | 2019-06-13T15:24:41.000Z | playground_env/.playground/connectors/passthrough/__init__.py | kandarpck/networksecurity2018 | dafe2ee8d39bd9596b1ce3fbc8b50ca645bcd626 | [
"MIT"
] | null | null | null | playground_env/.playground/connectors/passthrough/__init__.py | kandarpck/networksecurity2018 | dafe2ee8d39bd9596b1ce3fbc8b50ca645bcd626 | [
"MIT"
] | null | null | null | import playground
from .passthrough import pt_client, pt_server
passthrough_connector = playground.Connector(protocolStack=(
pt_client,
pt_server))
playground.setConnector('passthrough', passthrough_connector)
| 24.444444 | 61 | 0.818182 | import playground
from .passthrough import pt_client, pt_server
passthrough_connector = playground.Connector(protocolStack=(
pt_client,
pt_server))
playground.setConnector('passthrough', passthrough_connector)
| true | true |
f7fe5d3f1f2b914ef8863e51f4ff8041918b0ffa | 6,250 | py | Python | sunpy/map/sources/stereo.py | fluxtransport/sunpy | 351d3edca97e779179f367670292c95574c7a222 | [
"BSD-2-Clause"
] | null | null | null | sunpy/map/sources/stereo.py | fluxtransport/sunpy | 351d3edca97e779179f367670292c95574c7a222 | [
"BSD-2-Clause"
] | 1 | 2019-08-13T15:29:13.000Z | 2019-08-13T15:29:13.000Z | sunpy/map/sources/stereo.py | fluxtransport/sunpy | 351d3edca97e779179f367670292c95574c7a222 | [
"BSD-2-Clause"
] | 6 | 2017-03-15T07:17:05.000Z | 2020-09-30T18:36:49.000Z | """STEREO Map subclass definitions"""
__author__ = "Keith Hughitt"
__email__ = "keith.hughitt@nasa.gov"
import astropy.units as u
from astropy.visualization import PowerStretch
from astropy.visualization.mpl_normalize import ImageNormalize
from sunpy import log
from sunpy.map import GenericMap
from sunpy.map.source... | 35.714286 | 87 | 0.64128 |
__author__ = "Keith Hughitt"
__email__ = "keith.hughitt@nasa.gov"
import astropy.units as u
from astropy.visualization import PowerStretch
from astropy.visualization.mpl_normalize import ImageNormalize
from sunpy import log
from sunpy.map import GenericMap
from sunpy.map.sources.source_type import source_stretch
_... | true | true |
f7fe5e550e01e609505d8cf74bc3c4e468c94e54 | 367 | py | Python | demo/app/controller/main.py | shiroyuki/Tori | 143b99075bf9e8d469d117f056516ab847234c8c | [
"MIT"
] | null | null | null | demo/app/controller/main.py | shiroyuki/Tori | 143b99075bf9e8d469d117f056516ab847234c8c | [
"MIT"
] | 6 | 2015-01-19T20:21:40.000Z | 2015-01-19T20:28:42.000Z | demo/app/controller/main.py | shiroyuki/Tori | 143b99075bf9e8d469d117f056516ab847234c8c | [
"MIT"
] | null | null | null | from tori import Controller
from tori.decorator.controller import renderer
from tori.exception import *
@renderer('demo.app.views')
class MainController(Controller):
def get(self):
try:
self.render('index.html', title="Testing Ground", uri=self.request.uri)
... | 30.583333 | 83 | 0.621253 | from tori import Controller
from tori.decorator.controller import renderer
from tori.exception import *
@renderer('demo.app.views')
class MainController(Controller):
def get(self):
try:
self.render('index.html', title="Testing Ground", uri=self.request.uri)
... | true | true |
f7fe5effe3c45f615f137cee01e9cd7dced4fd2b | 29,587 | py | Python | sqlparse/keywords.py | testtctc/sqlparse | d30bb97efee15e3c84cd436ad10991183fc4ffe7 | [
"BSD-3-Clause"
] | null | null | null | sqlparse/keywords.py | testtctc/sqlparse | d30bb97efee15e3c84cd436ad10991183fc4ffe7 | [
"BSD-3-Clause"
] | null | null | null | sqlparse/keywords.py | testtctc/sqlparse | d30bb97efee15e3c84cd436ad10991183fc4ffe7 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (C) 2009-2020 the sqlparse authors and contributors
# <see AUTHORS file>
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
import re
from sqlparse import tokens
def is_keyword(value):
#是否是关键字
val = value.upper()
... | 30.72378 | 79 | 0.633961 |
import re
from sqlparse import tokens
def is_keyword(value):
val = value.upper()
return (KEYWORDS_COMMON.get(val)
or KEYWORDS_ORACLE.get(val)
or KEYWORDS_PLPGSQL.get(val)
or KEYWORDS_HQL.get(val)
or KEYWORDS.get(val, tokens.Name)), value
SQL_REGEX ... | true | true |
f7fe5f5f307063ef2a363000c8b682531216c607 | 1,618 | py | Python | dataset/SamplingDataSetRnet.py | swpucwf/MTCNN_Pytorch | d9ffd1ca8ea28eb4f7cd1e5d24d2ec8402f0e0b0 | [
"Apache-2.0"
] | null | null | null | dataset/SamplingDataSetRnet.py | swpucwf/MTCNN_Pytorch | d9ffd1ca8ea28eb4f7cd1e5d24d2ec8402f0e0b0 | [
"Apache-2.0"
] | null | null | null | dataset/SamplingDataSetRnet.py | swpucwf/MTCNN_Pytorch | d9ffd1ca8ea28eb4f7cd1e5d24d2ec8402f0e0b0 | [
"Apache-2.0"
] | null | null | null | import torch
from torch.utils.data import Dataset
import os
from torchvision.transforms import transforms
from PIL import Image
class FaceDataset(Dataset):
def __init__(self,path_1=r"D:\DataSet",path_2="D:\DataSet\wider",size=24,tf=transforms.ToTensor()):
super(FaceDataset, self).__init__()
self.da... | 32.36 | 103 | 0.573548 | import torch
from torch.utils.data import Dataset
import os
from torchvision.transforms import transforms
from PIL import Image
class FaceDataset(Dataset):
def __init__(self,path_1=r"D:\DataSet",path_2="D:\DataSet\wider",size=24,tf=transforms.ToTensor()):
super(FaceDataset, self).__init__()
self.da... | true | true |
f7fe5f7ea5da7a1c2f0d7e15ad992c72ffe12b0f | 177 | py | Python | scripts/add_path.py | XueLianjie/rpg_trajectory_evaluation | 7f49501d0fa09b5fa3790635ce68653ad8420d93 | [
"MIT"
] | 636 | 2018-10-03T10:37:54.000Z | 2022-03-29T12:36:11.000Z | scripts/add_path.py | XueLianjie/rpg_trajectory_evaluation | 7f49501d0fa09b5fa3790635ce68653ad8420d93 | [
"MIT"
] | 32 | 2018-10-12T07:43:39.000Z | 2022-03-18T09:46:56.000Z | scripts/add_path.py | XueLianjie/rpg_trajectory_evaluation | 7f49501d0fa09b5fa3790635ce68653ad8420d93 | [
"MIT"
] | 275 | 2018-10-06T12:48:46.000Z | 2022-03-14T07:52:48.000Z | #!/usr/bin/env python2
import os
import sys
sys.path.append(
os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../src/rpg_trajectory_evaluation'))
| 22.125 | 60 | 0.666667 |
import os
import sys
sys.path.append(
os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../src/rpg_trajectory_evaluation'))
| true | true |
f7fe5fa93f5b08ad07637ef68787f5ddcda596d8 | 4,428 | py | Python | examples/adwords/v201409/campaign_management/add_keywords_in_bulk.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | null | null | null | examples/adwords/v201409/campaign_management/add_keywords_in_bulk.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | null | null | null | examples/adwords/v201409/campaign_management/add_keywords_in_bulk.py | dietrichc/streamline-ppc-reports | 256f79246aba3c2cf8f792d87a066391a2f471e0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 31.183099 | 79 | 0.677733 |
"""This code sample illustrates how to perform asynchronous requests.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication information"
section of o... | false | true |
f7fe6045a0700d18c7c3dfbb20fa828b124aa0f5 | 7,677 | py | Python | salt/cli/batch.py | mattmb/salt | d02a718120cc202901437ef5ed8ec282c22178c3 | [
"Apache-2.0"
] | null | null | null | salt/cli/batch.py | mattmb/salt | d02a718120cc202901437ef5ed8ec282c22178c3 | [
"Apache-2.0"
] | null | null | null | salt/cli/batch.py | mattmb/salt | d02a718120cc202901437ef5ed8ec282c22178c3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Execute batch runs
'''
# Import python libs
from __future__ import absolute_import, print_function
import math
import time
import copy
# Import salt libs
import salt.client
import salt.output
from salt.utils import print_cli
# Import 3rd-party libs
# pylint: disable=import-error,no-name-i... | 36.383886 | 83 | 0.470366 |
from __future__ import absolute_import, print_function
import math
import time
import copy
import salt.client
import salt.output
from salt.utils import print_cli
import salt.ext.six as six
from salt.ext.six.moves import range
class Batch(object):
def __init__(self, opts, eauth=None, quiet=False):
... | true | true |
f7fe62e9d80211104fecfb8d49bbab2d7c99e009 | 3,651 | py | Python | coderunner/myapp/tests.py | kelseylyn/CodeRunner | 4085515e46ca1b2dab42c9f91598acbd70b9227e | [
"MIT"
] | null | null | null | coderunner/myapp/tests.py | kelseylyn/CodeRunner | 4085515e46ca1b2dab42c9f91598acbd70b9227e | [
"MIT"
] | null | null | null | coderunner/myapp/tests.py | kelseylyn/CodeRunner | 4085515e46ca1b2dab42c9f91598acbd70b9227e | [
"MIT"
] | null | null | null | from django.test import TestCase
# myapp/tests.py
from channels.testing import ChannelsLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.wait import WebDriverWait
class ChatTests(ChannelsLiveServerTestCase):
serve_stat... | 38.03125 | 115 | 0.650781 | from django.test import TestCase
from channels.testing import ChannelsLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.wait import WebDriverWait
class ChatTests(ChannelsLiveServerTestCase):
serve_static = True
... | true | true |
f7fe64a6acb2e2a59e42278b437fcbb3e026050b | 746 | py | Python | LeetCodeSolutions/python/652_Find_Duplicate_Subtrees.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | 1 | 2017-03-27T13:38:37.000Z | 2017-03-27T13:38:37.000Z | LeetCodeSolutions/python/652_Find_Duplicate_Subtrees.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | null | null | null | LeetCodeSolutions/python/652_Find_Duplicate_Subtrees.py | ChuanleiGuo/AlgorithmsPlayground | 90b6287b742c8bfd3797540c408d679be2821a40 | [
"MIT"
] | null | null | null | class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def findDuplicateSubtrees(self, root):
"""
:type root: TreeNode
:rtype: List[TreeNode]
"""
res = []
self.subtree_serial(root, d... | 27.62963 | 92 | 0.542895 | class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def findDuplicateSubtrees(self, root):
res = []
self.subtree_serial(root, dict(), res)
return res
def subtree_serial(self, cur, hash_map, res):
... | true | true |
f7fe655b6d6424d781be8957cb4989cf33dd3e62 | 934 | py | Python | lemur/plugins/bases/source.py | prdonahue/lemur | 267159af1950a77fa298275f234d7e458b91dda9 | [
"Apache-2.0"
] | null | null | null | lemur/plugins/bases/source.py | prdonahue/lemur | 267159af1950a77fa298275f234d7e458b91dda9 | [
"Apache-2.0"
] | 1 | 2022-03-29T22:05:53.000Z | 2022-03-29T22:05:53.000Z | lemur/plugins/bases/source.py | TinLe/lemur | dfb9e3a0c8f8f1f1bd908b1fcb8596af7c65f739 | [
"Apache-2.0"
] | null | null | null | """
.. module: lemur.plugins.bases.source
:platform: Unix
:copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
from lemur.plugins.base import Plugin
class SourcePlugin(Plugin):
type = 'sou... | 25.243243 | 81 | 0.624197 | from lemur.plugins.base import Plugin
class SourcePlugin(Plugin):
type = 'source'
default_options = [
{
'name': 'pollRate',
'type': 'int',
'required': False,
'helpMessage': 'Rate in seconds to poll source for new information.',
'default': '6... | true | true |
f7fe65a12de4eccfbbee75203b13bad6dff57dc2 | 27,558 | py | Python | tensorflow_probability/python/experimental/mcmc/gradient_based_trajectory_length_adaptation_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 3,670 | 2018-02-14T03:29:40.000Z | 2022-03-30T01:19:52.000Z | tensorflow_probability/python/experimental/mcmc/gradient_based_trajectory_length_adaptation_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1,395 | 2018-02-24T02:28:49.000Z | 2022-03-31T16:12:06.000Z | tensorflow_probability/python/experimental/mcmc/gradient_based_trajectory_length_adaptation_test.py | jakee417/probability-1 | ae7117f37ac441bc7a888167ea23e5e620c5bcde | [
"Apache-2.0"
] | 1,135 | 2018-02-14T01:51:10.000Z | 2022-03-28T02:24:11.000Z | # Copyright 2020 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 37.59618 | 80 | 0.684774 |
from absl.testing import parameterized
import numpy as np
import tensorflow.compat.v1 as tf1
import tensorflow.compat.v2 as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.internal import distribute_lib
from tensorflow_probability.python.internal import distribute_test_lib
from... | true | true |
f7fe65b23c0297d29f75693515a88dffa7e50e93 | 2,718 | py | Python | counters/views.py | aisahana/eclinic_api | feb67008f55f6af978adf2e55600ed17e7e514d3 | [
"MIT"
] | 5 | 2019-10-29T22:45:24.000Z | 2021-08-15T07:04:50.000Z | counters/views.py | AldiAE/eclinic_api | feb67008f55f6af978adf2e55600ed17e7e514d3 | [
"MIT"
] | 5 | 2020-06-06T00:16:24.000Z | 2022-02-10T10:43:15.000Z | counters/views.py | AldiAE/eclinic_api | feb67008f55f6af978adf2e55600ed17e7e514d3 | [
"MIT"
] | 8 | 2019-10-29T04:17:14.000Z | 2022-03-02T13:32:25.000Z | from rest_framework import viewsets, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.decorators import action
from rest_framework.permissions import IsAuthenticated, AllowAny
from rest_framework.response import Response
from counters.models import Counter, Queue
from counters.s... | 33.975 | 92 | 0.696836 | from rest_framework import viewsets, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.decorators import action
from rest_framework.permissions import IsAuthenticated, AllowAny
from rest_framework.response import Response
from counters.models import Counter, Queue
from counters.s... | true | true |
f7fe662a0c6c60ba566830b70edc654b6129c849 | 2,538 | py | Python | Dynamic-channels/test.py | void-zxh/CS337-SRDGI | e86413affd5867d42f9bbe66030d13b29bd2e067 | [
"MIT"
] | null | null | null | Dynamic-channels/test.py | void-zxh/CS337-SRDGI | e86413affd5867d42f9bbe66030d13b29bd2e067 | [
"MIT"
] | null | null | null | Dynamic-channels/test.py | void-zxh/CS337-SRDGI | e86413affd5867d42f9bbe66030d13b29bd2e067 | [
"MIT"
] | 1 | 2022-01-04T12:32:40.000Z | 2022-01-04T12:32:40.000Z | import argparse
import os
import time
import torch
from torch.autograd import Variable
from dynamic_channels import sample_tiny_sub_channel
from model import G
from util import is_image, load_image, save_image
parser = argparse.ArgumentParser(description='DeepRendering-implementation')
parser.add_argument(... | 45.321429 | 103 | 0.70922 | import argparse
import os
import time
import torch
from torch.autograd import Variable
from dynamic_channels import sample_tiny_sub_channel
from model import G
from util import is_image, load_image, save_image
parser = argparse.ArgumentParser(description='DeepRendering-implementation')
parser.add_argument(... | true | true |
f7fe67c0cfeb378edf623c5d01b3a275d4d5bf9d | 336 | py | Python | docs/add_glossary.py | NotMyFault/templating-engine-plugin | a3506f938a189909a5c8b921f18845b87a8ac5c7 | [
"Apache-2.0"
] | 133 | 2019-03-07T21:08:02.000Z | 2022-03-29T14:05:53.000Z | docs/add_glossary.py | NotMyFault/templating-engine-plugin | a3506f938a189909a5c8b921f18845b87a8ac5c7 | [
"Apache-2.0"
] | 156 | 2019-07-30T13:46:57.000Z | 2022-03-28T16:27:19.000Z | docs/add_glossary.py | NotMyFault/templating-engine-plugin | a3506f938a189909a5c8b921f18845b87a8ac5c7 | [
"Apache-2.0"
] | 61 | 2019-03-07T20:00:18.000Z | 2022-03-21T01:28:06.000Z | import mkdocs_gen_files
import os
import glob
# iterate over pages and append glossary
for file in glob.glob("/docs/docs/**/*.md", recursive = True):
if file.endswith('.md'):
text = open(file).read()
with mkdocs_gen_files.open(file.replace('/docs/docs/', ''), "w") as f:
print(text + '\n--8<-- "./glossa... | 33.6 | 74 | 0.64881 | import mkdocs_gen_files
import os
import glob
for file in glob.glob("/docs/docs/**/*.md", recursive = True):
if file.endswith('.md'):
text = open(file).read()
with mkdocs_gen_files.open(file.replace('/docs/docs/', ''), "w") as f:
print(text + '\n--8<-- "./glossary.md"', file=f) | true | true |
f7fe68d6d7de6e694493f5f30e97587cbc29d818 | 394 | py | Python | instagram_api/response/post_live_viewer_list.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | 13 | 2019-08-07T21:24:34.000Z | 2020-12-12T12:23:50.000Z | instagram_api/response/post_live_viewer_list.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | instagram_api/response/post_live_viewer_list.py | Yuego/instagram_api | b53f72db36c505a2eb24ebac1ba8267a0cc295bb | [
"MIT"
] | null | null | null | from .mapper import ApiResponse, ApiResponseInterface
from .mapper.types import Timestamp, AnyType
from .model import User
__all__ = ['PostLiveViewerListResponse']
class PostLiveViewerListResponseInterface(ApiResponseInterface):
users: [User]
next_max_id: str
total_viewer_count: int
class PostLiveViewe... | 24.625 | 83 | 0.814721 | from .mapper import ApiResponse, ApiResponseInterface
from .mapper.types import Timestamp, AnyType
from .model import User
__all__ = ['PostLiveViewerListResponse']
class PostLiveViewerListResponseInterface(ApiResponseInterface):
users: [User]
next_max_id: str
total_viewer_count: int
class PostLiveViewe... | true | true |
f7fe68f88a88b9128f190f27c71f8783dc3120dc | 607 | py | Python | integration_tests/test_leica_disto_r12.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 515 | 2017-01-25T05:46:52.000Z | 2022-03-29T09:52:27.000Z | integration_tests/test_leica_disto_r12.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 417 | 2017-01-25T10:01:17.000Z | 2022-03-29T09:22:04.000Z | integration_tests/test_leica_disto_r12.py | jkjt/ezdxf | 2acc5611b81476ea16b98063b9f55446a9182b81 | [
"MIT"
] | 149 | 2017-02-01T15:52:02.000Z | 2022-03-17T10:33:38.000Z | # Copyright (c) 2020, Manfred Moitzi
# License: MIT License
import os
import pytest
import ezdxf
BASEDIR = os.path.dirname(__file__)
DATADIR = "data"
@pytest.fixture(params=["Leica_Disto_S910.dxf"])
def filename(request):
filename = os.path.join(BASEDIR, DATADIR, request.param)
if not os.path.exists(filena... | 24.28 | 60 | 0.69687 |
import os
import pytest
import ezdxf
BASEDIR = os.path.dirname(__file__)
DATADIR = "data"
@pytest.fixture(params=["Leica_Disto_S910.dxf"])
def filename(request):
filename = os.path.join(BASEDIR, DATADIR, request.param)
if not os.path.exists(filename):
pytest.skip(f"File {filename} not found.")
... | true | true |
f7fe6aaab78490f28adb8207d40caa3e9121ddc2 | 663 | py | Python | modules/jquery/chuck_module.py | msabramo/django-chuck | bbef6171c9b3738460dc05cb77e65ba88fcc5ad8 | [
"BSD-2-Clause"
] | 1 | 2020-05-29T04:27:50.000Z | 2020-05-29T04:27:50.000Z | modules/jquery/chuck_module.py | msabramo/django-chuck | bbef6171c9b3738460dc05cb77e65ba88fcc5ad8 | [
"BSD-2-Clause"
] | null | null | null | modules/jquery/chuck_module.py | msabramo/django-chuck | bbef6171c9b3738460dc05cb77e65ba88fcc5ad8 | [
"BSD-2-Clause"
] | null | null | null | import subprocess
import os
description = """
Installs the jQuery javascript library into the static folders.
Please note, that this module requires Git in order to work properly.
For more information, visit:
http://jquery.org/
"""
def post_build():
jquery_dir = os.path.join(project_dir, 'static/scripts/libs/jq... | 27.625 | 72 | 0.636501 | import subprocess
import os
description = """
Installs the jQuery javascript library into the static folders.
Please note, that this module requires Git in order to work properly.
For more information, visit:
http://jquery.org/
"""
def post_build():
jquery_dir = os.path.join(project_dir, 'static/scripts/libs/jq... | true | true |
f7fe6cf13e7d36f7c5800d10790a765e3630fd45 | 3,994 | py | Python | src/cowrie/ssh_proxy/protocols/exec_term.py | iconnor/cowrie | 33c3f7c7d0ec797fd098043d4b1c201e8e1f4a11 | [
"BSD-3-Clause"
] | 1 | 2021-10-15T05:00:15.000Z | 2021-10-15T05:00:15.000Z | src/cowrie/ssh_proxy/protocols/exec_term.py | iconnor/cowrie | 33c3f7c7d0ec797fd098043d4b1c201e8e1f4a11 | [
"BSD-3-Clause"
] | 3 | 2021-09-13T02:37:23.000Z | 2022-03-03T21:48:46.000Z | src/cowrie/ssh_proxy/protocols/exec_term.py | iconnor/cowrie | 33c3f7c7d0ec797fd098043d4b1c201e8e1f4a11 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2016 Thomas Nicholson <tnnich@googlemail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, t... | 38.776699 | 87 | 0.641963 |
import os
import time
from twisted.python import log
from cowrie.core import ttylog
from cowrie.core.config import CowrieConfig
from cowrie.ssh_proxy.protocols import base_protocol
class ExecTerm(base_protocol.BaseProtocol):
def __init__(self, uuid, channelName, ssh, channelId, comma... | true | true |
f7fe6df0e3dabb730e3d388fe3b34f930ffd281f | 954 | py | Python | test/t_normalrdmbased.py | ZitongLu1996/PyCTRSA | 7b243930321c089e235c9fc1e771b6432d530819 | [
"MIT"
] | 17 | 2020-07-26T17:05:12.000Z | 2022-03-09T04:59:09.000Z | test/t_normalrdmbased.py | ZitongLu1996/PyCTRSA | 7b243930321c089e235c9fc1e771b6432d530819 | [
"MIT"
] | null | null | null | test/t_normalrdmbased.py | ZitongLu1996/PyCTRSA | 7b243930321c089e235c9fc1e771b6432d530819 | [
"MIT"
] | 3 | 2020-08-02T14:48:02.000Z | 2020-11-26T12:31:46.000Z | # -*- coding: utf-8
"""
@File : t_normalrdmbased.py
@Author : Zitong Lu
@Contact : zitonglu1996@gmail.com
@License : MIT License
"""
import numpy as np
import unittest
from pyctrsa.ctsimilarity.normalrdmbased import ctsimilarities_cal
class test_normalrdmbased(unittest.TestCase):
def tes... | 30.774194 | 66 | 0.675052 |
import numpy as np
import unittest
from pyctrsa.ctsimilarity.normalrdmbased import ctsimilarities_cal
class test_normalrdmbased(unittest.TestCase):
def test_ctsimilarities_cal(self):
RDMs = np.random.rand(20, 6, 6)
CTSimilarities = ctsimilarities_cal(RDMs)
self.assertEqual(CTSimilariti... | true | true |
f7fe6e12069e9f9aeeb94f79139bee9b65302204 | 3,491 | py | Python | test/test_bytesstorage.py | Pat-Laub/pyABC | f23f0ff8d430a8ce0a0c8253b45e19add9121992 | [
"BSD-3-Clause"
] | null | null | null | test/test_bytesstorage.py | Pat-Laub/pyABC | f23f0ff8d430a8ce0a0c8253b45e19add9121992 | [
"BSD-3-Clause"
] | null | null | null | test/test_bytesstorage.py | Pat-Laub/pyABC | f23f0ff8d430a8ce0a0c8253b45e19add9121992 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from pyabc.storage.bytes_storage import to_bytes, from_bytes
import pandas as pd
import numpy as np
import scipy as sp
from rpy2.robjects import r
import rpy2.robjects as robjects
from rpy2.robjects import pandas2ri
@pytest.fixture(params=["empty", "int", "float", "non_numeric_str",
... | 36.747368 | 78 | 0.496419 | import pytest
from pyabc.storage.bytes_storage import to_bytes, from_bytes
import pandas as pd
import numpy as np
import scipy as sp
from rpy2.robjects import r
import rpy2.robjects as robjects
from rpy2.robjects import pandas2ri
@pytest.fixture(params=["empty", "int", "float", "non_numeric_str",
... | true | true |
f7fe6ff68f166ec3b32d20a529d63d348ef8636d | 2,564 | py | Python | pypy/module/_rawffi/__init__.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | 1 | 2020-01-21T11:10:51.000Z | 2020-01-21T11:10:51.000Z | pypy/module/_rawffi/__init__.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | pypy/module/_rawffi/__init__.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null |
""" Low-level interface to clibffi
"""
from pypy.interpreter.mixedmodule import MixedModule
from pypy.module._rawffi.interp_rawffi import W_CDLL
from pypy.rpython.lltypesystem import lltype, rffi
from pypy.module._rawffi.tracker import Tracker
import sys
class Module(MixedModule):
interpleveldefs = {
'C... | 42.733333 | 88 | 0.640796 |
from pypy.interpreter.mixedmodule import MixedModule
from pypy.module._rawffi.interp_rawffi import W_CDLL
from pypy.rpython.lltypesystem import lltype, rffi
from pypy.module._rawffi.tracker import Tracker
import sys
class Module(MixedModule):
interpleveldefs = {
'CDLL' : 'interp_rawffi.W_C... | true | true |
f7fe703f6f2db29de7ef8d07447547769508e6c1 | 8,759 | py | Python | official/vision/beta/projects/simclr/heads/simclr_head.py | 1ucky40nc3/models | 1933222e454f0d2ab8582e48fcc46f26c36ace87 | [
"Apache-2.0"
] | 1 | 2021-05-22T12:50:50.000Z | 2021-05-22T12:50:50.000Z | official/vision/beta/projects/simclr/heads/simclr_head.py | DemonDamon/mask-detection-based-on-tf2odapi | 192ae544169c1230c21141c033800aa1bd94e9b6 | [
"MIT"
] | null | null | null | official/vision/beta/projects/simclr/heads/simclr_head.py | DemonDamon/mask-detection-based-on-tf2odapi | 192ae544169c1230c21141c033800aa1bd94e9b6 | [
"MIT"
] | null | null | null | # Copyright 2021 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... | 40.550926 | 81 | 0.67816 |
from typing import Text, Optional
import tensorflow as tf
from official.vision.beta.projects.simclr.modeling.layers import nn_blocks
regularizers = tf.keras.regularizers
layers = tf.keras.layers
@tf.keras.utils.register_keras_serializable(package='simclr')
class Projection... | true | true |
f7fe706cc3d2b9e764a5ada9585376ae6d90e939 | 692 | py | Python | post/admin.py | Neknu/news-site | 39606e099f742312bc203262bb9cc17b6c8a998d | [
"Apache-2.0"
] | null | null | null | post/admin.py | Neknu/news-site | 39606e099f742312bc203262bb9cc17b6c8a998d | [
"Apache-2.0"
] | 5 | 2021-03-19T10:51:15.000Z | 2021-06-10T20:12:59.000Z | post/admin.py | danylott/news-site | 39606e099f742312bc203262bb9cc17b6c8a998d | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Post
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
# prepopulated_fields = {'slug': ('title',)}
list_display = ['title', 'author', 'status', 'created']
fieldsets = [
('User content', {'fields': ['title', 'content', 'author']}),
... | 31.454545 | 69 | 0.634393 | from django.contrib import admin
from .models import Post
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
list_display = ['title', 'author', 'status', 'created']
fieldsets = [
('User content', {'fields': ['title', 'content', 'author']}),
('Admin info', {'fields': ['status', 'slug... | true | true |
f7fe70976e3c341cbe527d9e7563942cd20a1582 | 83 | py | Python | ChangeCoordinate/__init__.py | GaryLea/ChangeCoordinate | 5a2a94270b9b3eff59163b5bf32e1d2c4c5cd7a6 | [
"MIT"
] | 10 | 2019-07-17T06:41:49.000Z | 2021-11-24T01:17:07.000Z | ChangeCoordinate/__init__.py | GaryLea/ChangeCoordinate | 5a2a94270b9b3eff59163b5bf32e1d2c4c5cd7a6 | [
"MIT"
] | null | null | null | ChangeCoordinate/__init__.py | GaryLea/ChangeCoordinate | 5a2a94270b9b3eff59163b5bf32e1d2c4c5cd7a6 | [
"MIT"
] | 7 | 2019-09-21T11:56:31.000Z | 2021-12-10T06:47:38.000Z | # -*- coding: utf-8 -*-
from ChangeCoordinate.change_coordinate import ChangeCoord | 27.666667 | 58 | 0.771084 |
from ChangeCoordinate.change_coordinate import ChangeCoord | true | true |
f7fe739bf4e1a8a8f56b8db57b3c8fdf1d39edf3 | 14,911 | py | Python | flexget/tests/conftest.py | astrotee/Flexget | 34121f79eaef2ce27dd2d37b6d1c2e8dfbf98c51 | [
"MIT"
] | 1,322 | 2015-01-01T22:00:25.000Z | 2022-03-30T05:37:46.000Z | flexget/tests/conftest.py | astrotee/Flexget | 34121f79eaef2ce27dd2d37b6d1c2e8dfbf98c51 | [
"MIT"
] | 2,384 | 2015-01-01T04:23:15.000Z | 2022-03-31T01:06:43.000Z | flexget/tests/conftest.py | soloam/Flexget | f39812981d9ab2665358d8285c7ea7758759ab8d | [
"MIT"
] | 617 | 2015-01-02T15:15:07.000Z | 2022-03-15T12:29:31.000Z | import itertools
import logging
import os
import re
import shutil
import sys
from contextlib import contextmanager
from http import client
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
from unittest import mock
import flask
import jsonschema
import pytest
import requests
import yaml
f... | 32.988938 | 118 | 0.64382 | import itertools
import logging
import os
import re
import shutil
import sys
from contextlib import contextmanager
from http import client
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
from unittest import mock
import flask
import jsonschema
import pytest
import requests
import yaml
f... | true | true |
f7fe7452ae0237857a9b68aa5dbd9cc51bd907e4 | 3,984 | py | Python | Image/download.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | 1 | 2020-05-31T14:19:59.000Z | 2020-05-31T14:19:59.000Z | Image/download.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | null | null | null | Image/download.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | null | null | null | # %%
"""
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Image/download.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" href... | 48 | 1,021 | 0.735944 |
import subprocess
try:
import geemap
except ImportError:
print('geemap package not installed. Installing ...')
subprocess.check_call(["python", '-m', 'pip', 'install', 'geemap'])
try:
import google.colab
import geemap.eefolium as emap
except:
import geemap as emap
import ee
try:
... | true | true |
f7fe74a15292c234d13cbd919f84484b57430357 | 580 | py | Python | molecule/common/tests/test_pacemaker.py | incubateur-pe/pacemaker | 4b4bd65be4f87ba147a4a5a0739c0689e6ec5671 | [
"BSD-3-Clause"
] | null | null | null | molecule/common/tests/test_pacemaker.py | incubateur-pe/pacemaker | 4b4bd65be4f87ba147a4a5a0739c0689e6ec5671 | [
"BSD-3-Clause"
] | null | null | null | molecule/common/tests/test_pacemaker.py | incubateur-pe/pacemaker | 4b4bd65be4f87ba147a4a5a0739c0689e6ec5671 | [
"BSD-3-Clause"
] | null | null | null | """Role testing files using testinfra."""
import pytest
@pytest.mark.parametrize("name", [
"pcsd",
"corosync",
"pacemaker"
])
def test_cluster_services(host, name):
service = host.service(name)
# assert service.is_valid
assert service.is_enabled
assert service.is_running
def test_cluster... | 20 | 48 | 0.684483 | import pytest
@pytest.mark.parametrize("name", [
"pcsd",
"corosync",
"pacemaker"
])
def test_cluster_services(host, name):
service = host.service(name)
assert service.is_enabled
assert service.is_running
def test_cluster_status(host):
cmd = host.run("pcs status")
assert "2 nodes c... | true | true |
f7fe75f8e1e49e4cb85cb1a2e452d03481eb2601 | 6,044 | py | Python | BouncingBall014.py | BrianDunneKK/BouncingBall | bd491e4615b86c16179c7aac6c5e348ff85122b8 | [
"MIT"
] | null | null | null | BouncingBall014.py | BrianDunneKK/BouncingBall | bd491e4615b86c16179c7aac6c5e348ff85122b8 | [
"MIT"
] | null | null | null | BouncingBall014.py | BrianDunneKK/BouncingBall | bd491e4615b86c16179c7aac6c5e348ff85122b8 | [
"MIT"
] | null | null | null | import cdkk
import pygame
import random
# --------------------------------------------------
class Sprite_Ball(cdkk.Sprite):
files = ["ball_red.png", "ball_yellow.png", "ball_green.png", "ball_brown.png",
"ball_blue.png", "ball_pink.png", "ball_black.png"]
def __init__(self, value, limits):
... | 32.320856 | 83 | 0.587359 | import cdkk
import pygame
import random
class Sprite_Ball(cdkk.Sprite):
files = ["ball_red.png", "ball_yellow.png", "ball_green.png", "ball_brown.png",
"ball_blue.png", "ball_pink.png", "ball_black.png"]
def __init__(self, value, limits):
super().__init__()
self.load_image_from... | true | true |
f7fe760bdb51e989ee04ce549c78f9ce71ef5afe | 2,976 | py | Python | examples/config/settings.py | oliver-zhou/django-templated-mail | bcadd81e414aa53ba27dd42030bb85896688dc09 | [
"MIT"
] | 89 | 2017-09-19T10:04:51.000Z | 2022-02-10T08:29:40.000Z | examples/config/settings.py | oliver-zhou/django-templated-mail | bcadd81e414aa53ba27dd42030bb85896688dc09 | [
"MIT"
] | 21 | 2018-01-02T12:21:18.000Z | 2022-02-23T11:50:08.000Z | examples/config/settings.py | oliver-zhou/django-templated-mail | bcadd81e414aa53ba27dd42030bb85896688dc09 | [
"MIT"
] | 18 | 2018-01-17T11:01:31.000Z | 2021-12-17T03:39:36.000Z | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep th... | 25.220339 | 79 | 0.672379 | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '()!xq2ufm%j@n^!v^p08&w87vvg)rk^=aoj8u1(4xho5iuh-)l'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contentt... | true | true |
f7fe76988824699de105fb6240a54558dbfcb8b2 | 3,931 | py | Python | tests/modules/test_macho.py | CLEAR-seclab/viper | 58189220119a85c7a660f160cc664822de2c8412 | [
"BSD-3-Clause"
] | 2 | 2015-12-17T20:25:09.000Z | 2017-10-08T19:14:57.000Z | tests/modules/test_macho.py | detrojones/viper | 045e0952552fe29bb5e9780568486b36fd12e9ab | [
"BSD-3-Clause"
] | 1 | 2015-01-05T18:07:13.000Z | 2015-01-07T21:43:57.000Z | tests/modules/test_macho.py | detrojones/viper | 045e0952552fe29bb5e9780568486b36fd12e9ab | [
"BSD-3-Clause"
] | 3 | 2017-10-18T00:56:53.000Z | 2020-05-24T09:38:54.000Z | # -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
import os
import re
import pytest
from tests.conftest import FIXTURE_DIR
from viper.modules.macho import Macho, HAVE_MACHO
from viper.common.abstracts import Module
from vi... | 31.198413 | 85 | 0.622488 |
import os
import re
import pytest
from tests.conftest import FIXTURE_DIR
from viper.modules.macho import Macho, HAVE_MACHO
from viper.common.abstracts import Module
from viper.common.abstracts import ArgumentErrorCallback
from viper.core.session import __sessions__
class TestMacho:
def teardown_method(sel... | true | true |
f7fe76ab269b44c25fcc74c3b8d338ad3b600d39 | 4,439 | py | Python | stateoftheuniverse/widgets/constellations.py | Pratere/stateoftheuniverse | 2ad341cb9f0a45b8a624ba23a2dc3224e03de455 | [
"MIT"
] | null | null | null | stateoftheuniverse/widgets/constellations.py | Pratere/stateoftheuniverse | 2ad341cb9f0a45b8a624ba23a2dc3224e03de455 | [
"MIT"
] | null | null | null | stateoftheuniverse/widgets/constellations.py | Pratere/stateoftheuniverse | 2ad341cb9f0a45b8a624ba23a2dc3224e03de455 | [
"MIT"
] | null | null | null | """
Get a list of constellations that will be visible from a location on the
earth as a given time.
"""
# -------------------------
# Imports
# ------------------------
from astropy.utils.exceptions import AstropyDeprecationWarning
import warnings
from datetime import datetime as dt
from astropy import units as u
fro... | 35.230159 | 103 | 0.601487 |
from astropy.utils.exceptions import AstropyDeprecationWarning
import warnings
from datetime import datetime as dt
from astropy import units as u
from astropy.coordinates import SkyCoord, AltAz, get_constellation, EarthLocation
from astropy.time import Time
import numpy as np
from typing import Optional
from stateo... | true | true |
f7fe7748462965c14b63197643cfb9d0ea77e413 | 32 | py | Python | examples/python/mypackage/module.py | ech0-de/popper | 58b994660c954ab267407820e30d76a739a4d2df | [
"MIT"
] | 179 | 2016-11-19T22:38:07.000Z | 2020-05-24T10:42:30.000Z | examples/python/mypackage/module.py | ech0-de/popper | 58b994660c954ab267407820e30d76a739a4d2df | [
"MIT"
] | 739 | 2016-10-05T21:31:13.000Z | 2020-05-22T20:42:55.000Z | examples/python/mypackage/module.py | ech0-de/popper | 58b994660c954ab267407820e30d76a739a4d2df | [
"MIT"
] | 51 | 2016-10-14T05:42:10.000Z | 2020-05-15T19:05:33.000Z | def myfunc(x):
return x + 1
| 10.666667 | 16 | 0.5625 | def myfunc(x):
return x + 1
| true | true |
f7fe78db2738e5fc116176b624b1d6a2f4e865bb | 580 | py | Python | script/python3/util/__init__.py | setminami/IrControl | bcdd44b7f6aeca75226cdcfc611dc63032c38949 | [
"MIT"
] | null | null | null | script/python3/util/__init__.py | setminami/IrControl | bcdd44b7f6aeca75226cdcfc611dc63032c38949 | [
"MIT"
] | 2 | 2018-09-21T11:53:28.000Z | 2018-12-30T03:37:23.000Z | script/python3/util/__init__.py | setminami/IrControl | bcdd44b7f6aeca75226cdcfc611dc63032c38949 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# this made for python3
import logging, os
def is_debug(sysname='Darwin'):
""" for device debug """
return os.uname().sysname == sysname
def module_logger(modname):
logger = logging.getLogger(modname)
handler = logging.StreamHandler()
formatter = logging.Formatter('[%(ascti... | 32.222222 | 89 | 0.639655 |
import logging, os
def is_debug(sysname='Darwin'):
return os.uname().sysname == sysname
def module_logger(modname):
logger = logging.getLogger(modname)
handler = logging.StreamHandler()
formatter = logging.Formatter('[%(asctime)s | %(name)s | %(levelname)s] %(message)s',
... | true | true |
f7fe7906d343fc6cf019096931c1533d5633140d | 690 | py | Python | test/timing.py | plotnick/prettyprinter | edde630011ad5eada6476366a2b2da422f4a9d74 | [
"MIT"
] | null | null | null | test/timing.py | plotnick/prettyprinter | edde630011ad5eada6476366a2b2da422f4a9d74 | [
"MIT"
] | null | null | null | test/timing.py | plotnick/prettyprinter | edde630011ad5eada6476366a2b2da422f4a9d74 | [
"MIT"
] | null | null | null | from __future__ import with_statement
import timeit
setup = """
import pprint
import prettyprinter as pp
from format import format, parse_control_string
null = open("/dev/null", "w")
tupler = "(~{~A,~^ ~@{~A~^, ~}~})"
l = tuple(xrange(1000))
d = dict(zip(range(100), range(100, 200)))
"""[1:]
stmts = (("parse", """tup... | 28.75 | 66 | 0.573913 | from __future__ import with_statement
import timeit
setup = """
import pprint
import prettyprinter as pp
from format import format, parse_control_string
null = open("/dev/null", "w")
tupler = "(~{~A,~^ ~@{~A~^, ~}~})"
l = tuple(xrange(1000))
d = dict(zip(range(100), range(100, 200)))
"""[1:]
stmts = (("parse", """tup... | false | true |
f7fe7998d90376bfcb58386941deaf7b073ff2a4 | 3,812 | py | Python | archive/transfer_learning_runresults2.py | marjanin/tendon_stiffness | b1dc379b09bbf9c044410a6bc51afbee0cba2e05 | [
"MIT"
] | 1 | 2020-07-20T02:04:46.000Z | 2020-07-20T02:04:46.000Z | archive/transfer_learning_runresults2.py | marjanin/tendon_stiffness | b1dc379b09bbf9c044410a6bc51afbee0cba2e05 | [
"MIT"
] | null | null | null | archive/transfer_learning_runresults2.py | marjanin/tendon_stiffness | b1dc379b09bbf9c044410a6bc51afbee0cba2e05 | [
"MIT"
] | 1 | 2020-05-11T11:41:39.000Z | 2020-05-11T11:41:39.000Z |
# next is to add accel and see the difference
# add stiffness too
import numpy as np
from scipy import signal, stats
from matplotlib import pyplot as plt
from all_functions import *
import pickle
from warnings import simplefilter
simplefilter(action='ignore', category=FutureWarning)
experiment_ID = "transfer_learning... | 38.505051 | 87 | 0.705142 |
import numpy as np
from scipy import signal, stats
from matplotlib import pyplot as plt
from all_functions import *
import pickle
from warnings import simplefilter
simplefilter(action='ignore', category=FutureWarning)
experiment_ID = "transfer_learning_6"
errors_all_A_A = np.load("./results/{}/errors_all_A_A.npy".f... | true | true |
f7fe79e0ea2f62e8e12d449296f3fa9492d3b1cc | 11,653 | py | Python | tf_agents/policies/actor_policy_test.py | ayansengupta17/agents | c5a2f1f57d4fd0070eb75204aa0b1663de3e2c0a | [
"Apache-2.0"
] | 2 | 2021-02-02T06:56:58.000Z | 2021-04-21T08:39:45.000Z | tf_agents/policies/actor_policy_test.py | MarioBonse/agents | c727141f67051b86d2564c4bd5fbc080623bfe19 | [
"Apache-2.0"
] | null | null | null | tf_agents/policies/actor_policy_test.py | MarioBonse/agents | c727141f67051b86d2564c4bd5fbc080623bfe19 | [
"Apache-2.0"
] | 6 | 2020-10-09T06:33:23.000Z | 2022-02-03T16:16:36.000Z | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 41.322695 | 80 | 0.73878 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
from tf_agents.networks import actor_distribution_network
from tf_agents.n... | true | true |
f7fe7b39823cb214a93650991b086952e666f36c | 308 | py | Python | feedz/users/apps.py | Dimercel/feedz | d1f0ab1558b6df63452d1ac12847e3e816c83c31 | [
"MIT"
] | null | null | null | feedz/users/apps.py | Dimercel/feedz | d1f0ab1558b6df63452d1ac12847e3e816c83c31 | [
"MIT"
] | null | null | null | feedz/users/apps.py | Dimercel/feedz | d1f0ab1558b6df63452d1ac12847e3e816c83c31 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class UsersConfig(AppConfig):
name = "feedz.users"
verbose_name = _("Users")
def ready(self):
try:
import feedz.users.signals # noqa F401
except ImportError:
pass
| 22 | 54 | 0.649351 | from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class UsersConfig(AppConfig):
name = "feedz.users"
verbose_name = _("Users")
def ready(self):
try:
import feedz.users.signals
except ImportError:
pass
| true | true |
f7fe7b7cddac60490fd507db0067a3b0e0cf4da2 | 2,858 | py | Python | janitor/functions/collapse_levels.py | thatlittleboy/pyjanitor | f7977e00d3d9bf49aebeaa62db2965a668c50c90 | [
"MIT"
] | null | null | null | janitor/functions/collapse_levels.py | thatlittleboy/pyjanitor | f7977e00d3d9bf49aebeaa62db2965a668c50c90 | [
"MIT"
] | null | null | null | janitor/functions/collapse_levels.py | thatlittleboy/pyjanitor | f7977e00d3d9bf49aebeaa62db2965a668c50c90 | [
"MIT"
] | null | null | null | """Implementation of the `collapse_levels` function."""
import pandas as pd
import pandas_flavor as pf
from janitor.utils import check
@pf.register_dataframe_method
def collapse_levels(df: pd.DataFrame, sep: str = "_") -> pd.DataFrame:
"""Flatten multi-level column dataframe to a single level.
This method m... | 35.283951 | 81 | 0.607068 | import pandas as pd
import pandas_flavor as pf
from janitor.utils import check
@pf.register_dataframe_method
def collapse_levels(df: pd.DataFrame, sep: str = "_") -> pd.DataFrame:
check("sep", sep, [str])
if not isinstance(df.columns, pd.MultiIndex):
return df
df.columns = [
sep.jo... | true | true |
f7fe7be8107302b407a6207200066210a6ed92fc | 847 | py | Python | Chapter09/extract_stats.py | marcjour303/PytML | cd1391976167a7a671e98a1f588898c01585cee9 | [
"MIT"
] | 36 | 2019-04-05T00:58:57.000Z | 2022-03-12T09:25:04.000Z | Chapter09/extract_stats.py | ClauPorto/Python-Machine-Learning-Cookbook-Second-Edition | 99d8b799dbfe1d9a82f0bcc3648aaeb147b7298f | [
"MIT"
] | null | null | null | Chapter09/extract_stats.py | ClauPorto/Python-Machine-Learning-Cookbook-Second-Edition | 99d8b799dbfe1d9a82f0bcc3648aaeb147b7298f | [
"MIT"
] | 37 | 2019-04-16T00:50:20.000Z | 2022-02-28T18:14:41.000Z | import pandas as pd
import matplotlib.pyplot as plt
from convert_to_timeseries import convert_data_to_timeseries
# Input file containing data
input_file = 'data_timeseries.txt'
# Load data
data1 = convert_data_to_timeseries(input_file, 2)
data2 = convert_data_to_timeseries(input_file, 3)
dataframe = pd.DataFrame({'f... | 23.527778 | 60 | 0.75915 | import pandas as pd
import matplotlib.pyplot as plt
from convert_to_timeseries import convert_data_to_timeseries
input_file = 'data_timeseries.txt'
data1 = convert_data_to_timeseries(input_file, 2)
data2 = convert_data_to_timeseries(input_file, 3)
dataframe = pd.DataFrame({'first': data1, 'second': data2})
print... | true | true |
f7fe7c3e9a50e5313f3c1ed8e488b4a3eb47b65e | 332 | py | Python | school/migrations/0018_auto_20200610_0808.py | ankit986/school-management | cdffab5280199856397cdef36d18e84def841f93 | [
"MIT"
] | null | null | null | school/migrations/0018_auto_20200610_0808.py | ankit986/school-management | cdffab5280199856397cdef36d18e84def841f93 | [
"MIT"
] | 6 | 2021-03-19T04:29:01.000Z | 2021-09-22T19:09:31.000Z | school/migrations/0018_auto_20200610_0808.py | ankit986/school-management | cdffab5280199856397cdef36d18e84def841f93 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-06-10 08:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('school', '0017_auto_20200610_0807'),
]
operations = [
migrations.RenameModel(
old_name='Subjects',
new_name='Subject',
... | 18.444444 | 47 | 0.596386 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('school', '0017_auto_20200610_0807'),
]
operations = [
migrations.RenameModel(
old_name='Subjects',
new_name='Subject',
),
]
| true | true |
f7fe7fb8c35219db1d8d21029b362a1bc08ef011 | 781 | py | Python | venv/bin/rst2html4.py | anthodemorais/spaces | e2f4b70bf2438a39ce1e1bd954f8dc98bea5280d | [
"MIT"
] | null | null | null | venv/bin/rst2html4.py | anthodemorais/spaces | e2f4b70bf2438a39ce1e1bd954f8dc98bea5280d | [
"MIT"
] | null | null | null | venv/bin/rst2html4.py | anthodemorais/spaces | e2f4b70bf2438a39ce1e1bd954f8dc98bea5280d | [
"MIT"
] | null | null | null | #!/Users/anthonydemorais/Documents/travail/supinternet/python/spaces/venv/bin/python3
# $Id: rst2html4.py 7994 2016-12-10 17:41:45Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A minimal front end to the Docutils Publisher, producing (X)HTML.
... | 28.925926 | 85 | 0.754161 |
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
from docutils.core import publish_cmdline, default_description
description = ('Generates (X)HTML documents from standalone reStructuredText '
'sources. ' + default_description)
publish_cmdline(writer_name='html4',... | true | true |
f7fe7fe0ec0ed226b6d14b0fd44f387f10cebd93 | 10,897 | py | Python | custom_components/awox/config_flow.py | valentingc/home-assistant-awox | 3015f524404962b66bad961b446a37263b717882 | [
"MIT"
] | null | null | null | custom_components/awox/config_flow.py | valentingc/home-assistant-awox | 3015f524404962b66bad961b446a37263b717882 | [
"MIT"
] | null | null | null | custom_components/awox/config_flow.py | valentingc/home-assistant-awox | 3015f524404962b66bad961b446a37263b717882 | [
"MIT"
] | null | null | null | """Config flow for AwoX MESH lights"""
from typing import Mapping, Optional
import logging
import pygatt
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_USERNAME,
CONF_PASSWORD
)
from .scanner import DeviceScanner
from .const import DOMAIN, CONF_MESH_N... | 35.611111 | 117 | 0.578691 |
from typing import Mapping, Optional
import logging
import pygatt
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_USERNAME,
CONF_PASSWORD
)
from .scanner import DeviceScanner
from .const import DOMAIN, CONF_MESH_NAME, CONF_MESH_PASSWORD, CONF_MESH_KEY
... | true | true |
f7fe80cc025cab2659f427cb5a3aa43e110f43d1 | 992 | py | Python | samples/v1beta1/test_create_entry_group.py | LaudateCorpus1/python-datacatalog | 7d8c3bc9bf540d3e5c0b0bd80a619792162c4fe2 | [
"Apache-2.0"
] | 41 | 2020-05-12T08:00:04.000Z | 2022-03-28T22:54:06.000Z | samples/v1beta1/test_create_entry_group.py | LaudateCorpus1/python-datacatalog | 7d8c3bc9bf540d3e5c0b0bd80a619792162c4fe2 | [
"Apache-2.0"
] | 114 | 2020-02-07T02:48:37.000Z | 2022-03-23T00:46:01.000Z | samples/v1beta1/test_create_entry_group.py | LaudateCorpus1/python-datacatalog | 7d8c3bc9bf540d3e5c0b0bd80a619792162c4fe2 | [
"Apache-2.0"
] | 21 | 2020-01-31T21:14:59.000Z | 2022-02-15T07:26:39.000Z | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.066667 | 79 | 0.729839 |
import create_entry_group
def test_create_entry_group(capsys, client, project_id, random_entry_group_id):
create_entry_group.create_entry_group(project_id, random_entry_group_id)
out, err = capsys.readouterr()
assert (
"Created entry group"
" projects/{}/locations/{}/entryG... | true | true |
f7fe80e8482fbcf1ea81dec053a2c1afcba45fd1 | 497 | py | Python | samples/python/preview.py | tmq902005/RealSenseID | b6882748cc7f47e041089c09a40eab6b0043fc9f | [
"Apache-2.0"
] | 63 | 2020-12-27T16:56:36.000Z | 2022-03-25T06:20:36.000Z | samples/python/preview.py | tmq902005/RealSenseID | b6882748cc7f47e041089c09a40eab6b0043fc9f | [
"Apache-2.0"
] | 122 | 2021-01-14T11:14:28.000Z | 2022-03-08T06:15:29.000Z | samples/python/preview.py | Surfndez/RealSenseID | f29171b8a5aba828d40e0ab120550730e5fbc080 | [
"Apache-2.0"
] | 39 | 2020-12-30T09:58:24.000Z | 2022-03-18T01:58:40.000Z | """
License: Apache 2.0. See LICENSE file in root directory.
Copyright(c) 2020-2021 Intel Corporation. All Rights Reserved.
"""
import time
import os
import rsid_py
def on_image(frame):
print(f'got_frame #{frame.number} {frame.width}x{frame.height}')
if frame.number > 10:
os._exit(0)
if __name__ == ... | 23.666667 | 68 | 0.698189 | import time
import os
import rsid_py
def on_image(frame):
print(f'got_frame #{frame.number} {frame.width}x{frame.height}')
if frame.number > 10:
os._exit(0)
if __name__ == '__main__':
preview_cfg = rsid_py.PreviewConfig()
preview_cfg.camera_number = 0
p = rsid_py.Preview(preview_cfg)
... | true | true |
f7fe80f2f6670205bcd2605e627c18a2e743f195 | 3,753 | py | Python | test/jobTest.py | harvardinformatics/jobTree | b4bdaeb2462b90ab8251713d4d2d8130c842cbe0 | [
"MIT"
] | 10 | 2015-02-05T16:02:06.000Z | 2020-07-17T06:12:42.000Z | test/jobTest.py | harvardinformatics/jobTree | b4bdaeb2462b90ab8251713d4d2d8130c842cbe0 | [
"MIT"
] | 16 | 2015-01-06T05:56:58.000Z | 2015-10-07T01:03:37.000Z | test/jobTest.py | benedictpaten/jobTree | 072be69f6214e06bd8588b5e73a60b758c191663 | [
"MIT"
] | 14 | 2015-01-05T23:34:12.000Z | 2019-03-07T17:45:17.000Z | #!/usr/bin/env python
"""Test Job class
"""
import unittest
import os
import time
import sys
import random
from sonLib.bioio import parseSuiteTestOptions
from sonLib.bioio import logger, system
from jobTree.src.job import Job
class TestCase(unittest.TestCase):
def testJobReadWriteAndDelete(self):
jobDir... | 39.09375 | 132 | 0.57927 |
"""Test Job class
"""
import unittest
import os
import time
import sys
import random
from sonLib.bioio import parseSuiteTestOptions
from sonLib.bioio import logger, system
from jobTree.src.job import Job
class TestCase(unittest.TestCase):
def testJobReadWriteAndDelete(self):
jobDir = os.path.join(os.ge... | false | true |
f7fe81eb8b18aea5e9f85788db3c3c72624547db | 1,278 | py | Python | hs_core/tests/api/rest/test_resource_meta.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_core/tests/api/rest/test_resource_meta.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_core/tests/api/rest/test_resource_meta.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | import os
import json
import tempfile
import shutil
from lxml import etree
from rest_framework import status
from hs_core.hydroshare import resource
from .base import HSRESTTestCase
class TestResourceMetadata(HSRESTTestCase):
def setUp(self):
super(TestResourceMetadata, self).setUp()
self.rty... | 33.631579 | 81 | 0.656495 | import os
import json
import tempfile
import shutil
from lxml import etree
from rest_framework import status
from hs_core.hydroshare import resource
from .base import HSRESTTestCase
class TestResourceMetadata(HSRESTTestCase):
def setUp(self):
super(TestResourceMetadata, self).setUp()
self.rty... | true | true |
f7fe822d158e70215afe6a1961af6b057bea9abb | 875 | py | Python | setup.py | jialuechen/raptor | bac516a45dfee9d21ac14221a2d9d5bef810cbd0 | [
"MIT"
] | null | null | null | setup.py | jialuechen/raptor | bac516a45dfee9d21ac14221a2d9d5bef810cbd0 | [
"MIT"
] | null | null | null | setup.py | jialuechen/raptor | bac516a45dfee9d21ac14221a2d9d5bef810cbd0 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name="raptor",
packages=["raptor"],
version="0.1.0",
description="Technical Analysis Library",
long_description="It is a Technical Analysis library to financial time series datasets.",
author="Julius Chen",
author_email="quantchen@protonmail.com",
... | 31.25 | 93 | 0.649143 | from distutils.core import setup
setup(
name="raptor",
packages=["raptor"],
version="0.1.0",
description="Technical Analysis Library",
long_description="It is a Technical Analysis library to financial time series datasets.",
author="Julius Chen",
author_email="quantchen@protonmail.com",
... | true | true |
f7fe82420c012cc1f5bb4fa6be66f74146bdf04f | 13,963 | py | Python | lib/interface.py | Messer4/electrum-cash | 531547ec2b0f26569caddbf6f1037095c200d4e6 | [
"MIT"
] | 1 | 2018-01-15T04:34:53.000Z | 2018-01-15T04:34:53.000Z | lib/interface.py | Messer4/electrum-cash | 531547ec2b0f26569caddbf6f1037095c200d4e6 | [
"MIT"
] | null | null | null | lib/interface.py | Messer4/electrum-cash | 531547ec2b0f26569caddbf6f1037095c200d4e6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including witho... | 34.476543 | 103 | 0.563919 |
import os
import re
import socket
import ssl
import sys
import threading
import time
import traceback
import requests
from .util import print_error
ca_path = requests.certs.where()
from . import util
from . import x509
from . import pem
def Connection(server, queue, config_path):
host,... | true | true |
f7fe83299a66644de31003a17d8b9e1d748891ee | 1,334 | py | Python | spanner/tests/system/utils/scrub_instances.py | jo2y/google-cloud-python | 1b76727be16bc4335276f793340bb72d32be7166 | [
"Apache-2.0"
] | 1 | 2018-06-29T17:53:28.000Z | 2018-06-29T17:53:28.000Z | spanner/tests/system/utils/scrub_instances.py | jo2y/google-cloud-python | 1b76727be16bc4335276f793340bb72d32be7166 | [
"Apache-2.0"
] | 4 | 2018-11-13T22:15:36.000Z | 2018-12-07T18:31:38.000Z | spanner/tests/system/utils/scrub_instances.py | jo2y/google-cloud-python | 1b76727be16bc4335276f793340bb72d32be7166 | [
"Apache-2.0"
] | 1 | 2021-06-30T11:44:03.000Z | 2021-06-30T11:44:03.000Z | # Copyright 2017 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 35.105263 | 74 | 0.703148 |
from google.cloud.spanner import Client
from .streaming_utils import INSTANCE_NAME as STREAMING_INSTANCE
STANDARD_INSTANCE = 'google-cloud-python-systest'
def scrub_instances(client):
for instance in client.list_instances():
if instance.name == STREAMING_INSTANCE:
print('Not del... | true | true |
f7fe8377430d72eab44fd5820adc26aa07a46ba2 | 6,769 | py | Python | models/sequential_model.py | aasseman/mi-prometheus | c655c88cc6aec4d0724c19ea95209f1c2dd6770d | [
"Apache-2.0"
] | null | null | null | models/sequential_model.py | aasseman/mi-prometheus | c655c88cc6aec4d0724c19ea95209f1c2dd6770d | [
"Apache-2.0"
] | null | null | null | models/sequential_model.py | aasseman/mi-prometheus | c655c88cc6aec4d0724c19ea95209f1c2dd6770d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) IBM Corporation 2018
#
# 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
#
# U... | 36.589189 | 97 | 0.622987 |
__author__ = "Tomasz Kornuta"
import numpy as np
import logging
import torch
from models.model import Model
from problems.problem import DataTuple
class SequentialModel(Model):
def __init__(self, params):
super(SequentialModel, self).__init__(params)
def plot(self, data_tuple, pre... | true | true |
f7fe8399b91c10eca23e3b1a1abbacc1912f9d54 | 1,591 | py | Python | county_boundaries/python/main.py | CrunchyData/crunchy-foss4g-demodata | 1d8f92a07faf9bc1c6468e00c8e9148ae2ba8dfc | [
"Apache-2.0"
] | 9 | 2019-08-03T01:08:53.000Z | 2021-12-30T21:01:28.000Z | county_boundaries/python/main.py | CrunchyData/crunchy-foss4g-demodata | 1d8f92a07faf9bc1c6468e00c8e9148ae2ba8dfc | [
"Apache-2.0"
] | 11 | 2019-04-04T13:56:29.000Z | 2020-07-15T18:29:13.000Z | county_boundaries/python/main.py | CrunchyData/crunchy-foss4g-demodata | 1d8f92a07faf9bc1c6468e00c8e9148ae2ba8dfc | [
"Apache-2.0"
] | 2 | 2020-10-23T00:31:06.000Z | 2020-12-26T10:38:31.000Z | import fiona
from shapely.geometry import shape
from shapely.geometry import Point
from shapely.geometry import Polygon
from shapely.geometry import MultiPolygon
from shapely.wkb import dumps
import pprint
with fiona.open("../shapefile/tl_2018_us_county.shp", "r") as features:
pprint.pprint(next(features))
p... | 36.159091 | 71 | 0.568196 | import fiona
from shapely.geometry import shape
from shapely.geometry import Point
from shapely.geometry import Polygon
from shapely.geometry import MultiPolygon
from shapely.wkb import dumps
import pprint
with fiona.open("../shapefile/tl_2018_us_county.shp", "r") as features:
pprint.pprint(next(features))
p... | true | true |
f7fe83d525177aa784e9d88b687bc0ef6c672ca1 | 26,304 | py | Python | src/consensus.py | isovic/samscripts | 4b8c122220ee7bc5909903e3ecabb8ed6a72965d | [
"MIT"
] | 4 | 2015-09-30T13:17:47.000Z | 2019-03-13T14:25:15.000Z | src/consensus.py | isovic/samscripts | 4b8c122220ee7bc5909903e3ecabb8ed6a72965d | [
"MIT"
] | 5 | 2015-11-09T09:21:44.000Z | 2016-08-18T09:18:44.000Z | src/consensus.py | isovic/samscripts | 4b8c122220ee7bc5909903e3ecabb8ed6a72965d | [
"MIT"
] | 6 | 2015-05-11T09:04:52.000Z | 2020-06-08T21:47:51.000Z | #! /usr/bin/env python
# Copyright Ivan Sovic, 2015. www.sovic.org
#
# Creates a pileup from a given SAM/BAM file, and calls consensus bases (or variants).
import os;
import sys;
import operator;
import subprocess;
def increase_in_dict(dict_counter, value):
try:
dict_counter[value] += 1;
except:
dict_counter[v... | 46.555752 | 493 | 0.701718 |
import os;
import sys;
import operator;
import subprocess;
def increase_in_dict(dict_counter, value):
try:
dict_counter[value] += 1;
except:
dict_counter[value] = 1;
def process_mpileup_line(line, line_number, ret_variant_list, ret_vcf_list, ret_snp_count, ret_insertion_count, ret_deletion_count, ret_num_... | false | true |
f7fe83ebf8fc4ea77d58cdf5ea08a00b8eb21944 | 39 | py | Python | sentiment_analysis/data_provider.py | mengfanShi/SpiderMan | 679b3b5b64e8e6883eca0a22ddeec23a7a9d61bb | [
"MIT"
] | 1 | 2018-01-02T17:07:28.000Z | 2018-01-02T17:07:28.000Z | sentiment_analysis/data_provider.py | mengfanShi/SpiderMan | 679b3b5b64e8e6883eca0a22ddeec23a7a9d61bb | [
"MIT"
] | null | null | null | sentiment_analysis/data_provider.py | mengfanShi/SpiderMan | 679b3b5b64e8e6883eca0a22ddeec23a7a9d61bb | [
"MIT"
] | 2 | 2018-01-02T15:38:36.000Z | 2021-04-06T05:50:41.000Z | # -*- coding: utf-8 -*-
import jieba
| 7.8 | 23 | 0.538462 |
import jieba
| true | true |
f7fe84288dcebceea381116a51baee3b3a17183d | 2,127 | py | Python | src_multilevel/utils/data_processor.py | vineetjohn/ecom-sigir-task-2018 | 1be3d5670912e43cf21090faf3b4f51ac3bbba9f | [
"MIT"
] | 1 | 2018-08-07T12:38:47.000Z | 2018-08-07T12:38:47.000Z | src_multilevel/utils/data_processor.py | vineetjohn/ecom-sigir-task-2018 | 1be3d5670912e43cf21090faf3b4f51ac3bbba9f | [
"MIT"
] | null | null | null | src_multilevel/utils/data_processor.py | vineetjohn/ecom-sigir-task-2018 | 1be3d5670912e43cf21090faf3b4f51ac3bbba9f | [
"MIT"
] | null | null | null | import logging
import re
import spacy
from spacy.lang.en import English
from src.config import global_config
from src.utils import stopword_aggregator
logger = logging.getLogger(global_config.logger_name)
def is_valid_token(token):
return len(token) >= 3 and token not in stopword_aggregator.custom_stopwords
... | 31.746269 | 112 | 0.652562 | import logging
import re
import spacy
from spacy.lang.en import English
from src.config import global_config
from src.utils import stopword_aggregator
logger = logging.getLogger(global_config.logger_name)
def is_valid_token(token):
return len(token) >= 3 and token not in stopword_aggregator.custom_stopwords
... | true | true |
f7fe8436091bd5d409cc6f6db5d50d49536600c2 | 17,601 | py | Python | python_modules/dagster/dagster/core/definitions/resource_definition.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 4,606 | 2018-06-21T17:45:20.000Z | 2022-03-31T23:39:42.000Z | python_modules/dagster/dagster/core/definitions/resource_definition.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 6,221 | 2018-06-12T04:36:01.000Z | 2022-03-31T21:43:05.000Z | python_modules/dagster/dagster/core/definitions/resource_definition.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 619 | 2018-08-22T22:43:09.000Z | 2022-03-31T22:48:06.000Z | from collections import namedtuple
from functools import update_wrapper
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
Dict,
List,
Optional,
Union,
cast,
overload,
)
from dagster import check
from dagster.core.definitions.config import is_callable_valid_config_a... | 40.002273 | 125 | 0.684279 | from collections import namedtuple
from functools import update_wrapper
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
Dict,
List,
Optional,
Union,
cast,
overload,
)
from dagster import check
from dagster.core.definitions.config import is_callable_valid_config_a... | true | true |
f7fe84ce03cdd504b8f1583950e160169cbd9d90 | 3,878 | py | Python | python/bot.py | dev-null-undefined/felix | addad2375bc46683c75674ba83acc04495526830 | [
"MIT"
] | 135 | 2018-09-08T18:56:27.000Z | 2022-03-24T10:27:34.000Z | python/bot.py | dev-null-undefined/felix | addad2375bc46683c75674ba83acc04495526830 | [
"MIT"
] | 73 | 2018-09-29T07:40:10.000Z | 2022-03-06T11:57:19.000Z | python/bot.py | dev-null-undefined/felix | addad2375bc46683c75674ba83acc04495526830 | [
"MIT"
] | 105 | 2018-09-08T20:52:32.000Z | 2022-03-03T16:16:23.000Z | """Felix Discord Bot
This file starts the bot and loads all extensions/cogs and configs/permissions
The Bot automatically tries to load all extensions found in the "cogs/" folder
plus the hangman.hangman extension.
An extension can be reloaded without restarting the bot.
The extension "management" provides the comman... | 32.049587 | 93 | 0.676637 | import json
import traceback
import sys
from datetime import datetime
from os import path, listdir
from discord.ext.commands import Bot, when_mentioned_or
from discord import DMChannel, Message, Activity, Intents, AllowedMentions
from aiohttp import ClientSession, ClientTimeout
class Felix(Bot):
def __init__(self... | true | true |
f7fe84f5af308e1f6c379272bf01425d466b1ac6 | 518 | py | Python | myBinaries/src/kvs/workloadGen.py | alex1230608/gem5 | d5225681568102a6441ce2c32d82f5b1b45ea4e2 | [
"BSD-3-Clause"
] | null | null | null | myBinaries/src/kvs/workloadGen.py | alex1230608/gem5 | d5225681568102a6441ce2c32d82f5b1b45ea4e2 | [
"BSD-3-Clause"
] | null | null | null | myBinaries/src/kvs/workloadGen.py | alex1230608/gem5 | d5225681568102a6441ce2c32d82f5b1b45ea4e2 | [
"BSD-3-Clause"
] | null | null | null | num_nic = 2
time_period = 100
separate = 10000
test_range = 2
test_repeat = 300
interval = 1
sharded = 1
readWrite = 1
print("%d"%num_nic)
for nic in range(0, num_nic):
print "%d"%(test_repeat*(test_range/interval)),
print ""
for nic in range(0, num_nic):
if sharded == 1:
start = nic*separate
else:
start = 0... | 17.266667 | 48 | 0.662162 | num_nic = 2
time_period = 100
separate = 10000
test_range = 2
test_repeat = 300
interval = 1
sharded = 1
readWrite = 1
print("%d"%num_nic)
for nic in range(0, num_nic):
print "%d"%(test_repeat*(test_range/interval)),
print ""
for nic in range(0, num_nic):
if sharded == 1:
start = nic*separate
else:
start = 0... | false | true |
f7fe8605c92c4ee75d7e0097fdb100a8c6fd6e57 | 6,501 | py | Python | bocce/utils.py | brianjpetersen/bocce | 20a4845400e8759173c5391ce52f18dafbf4c678 | [
"MIT"
] | null | null | null | bocce/utils.py | brianjpetersen/bocce | 20a4845400e8759173c5391ce52f18dafbf4c678 | [
"MIT"
] | null | null | null | bocce/utils.py | brianjpetersen/bocce | 20a4845400e8759173c5391ce52f18dafbf4c678 | [
"MIT"
] | null | null | null | # standard libraries
import os
import functools
import collections
import collections.abc
import datetime
import json
import multiprocessing
import threading
import traceback
import time
# third party libraries
pass
# first party libraries
pass
__where__ = os.path.dirname(os.path.abspath(__file__))
class repeat(thr... | 26.21371 | 69 | 0.557607 |
import os
import functools
import collections
import collections.abc
import datetime
import json
import multiprocessing
import threading
import traceback
import time
pass
pass
__where__ = os.path.dirname(os.path.abspath(__file__))
class repeat(threading.Thread):
def __init__(self, function, period, how=... | true | true |
f7fe88093ad7d02c94f780d3849b03a3795789a9 | 14,209 | py | Python | JFit/physics/nu_oscillation/Prob_e2e.py | J-Fit/JFit | 85c67aaca0295a75714db2011e35222dabf50c38 | [
"MIT"
] | 1 | 2021-03-02T12:51:42.000Z | 2021-03-02T12:51:42.000Z | JFit/physics/nu_oscillation/Prob_e2e.py | J-Fit/JFit | 85c67aaca0295a75714db2011e35222dabf50c38 | [
"MIT"
] | null | null | null | JFit/physics/nu_oscillation/Prob_e2e.py | J-Fit/JFit | 85c67aaca0295a75714db2011e35222dabf50c38 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
''' pure nue -> nue
author: Jinnan Zhang
zhangjinnan@ihep.ac.cn
date: 2021.03.08
'''
import numpy as np
def get_parser():
import argparse
parser = argparse.ArgumentParser(description="Check or show the oscillation pattern.")
parser.add_argument(
"--cME",
action="stor... | 44.823344 | 139 | 0.597157 |
import numpy as np
def get_parser():
import argparse
parser = argparse.ArgumentParser(description="Check or show the oscillation pattern.")
parser.add_argument(
"--cME",
action="store_true",
help="Check the matter effect model, the JUNO Yellow book model, the Yufeng model, and the ... | true | true |
f7fe881573c50b01cca6dca48fde1cc4ad374b83 | 2,316 | py | Python | examples/ami/sd0/local/dataio.py | phecda-xu/PaddleSpeech | 6bf0d3bf57229091a74912633e837dabc6215c86 | [
"Apache-2.0"
] | 1 | 2022-02-26T01:48:00.000Z | 2022-02-26T01:48:00.000Z | examples/ami/sd0/local/dataio.py | ziwenag/PaddleSpeech | 89e69ee10ee02b875af663146bc46fcf095e812a | [
"Apache-2.0"
] | null | null | null | examples/ami/sd0/local/dataio.py | ziwenag/PaddleSpeech | 89e69ee10ee02b875af663146bc46fcf095e812a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 23.632653 | 74 | 0.6019 |
import os
import pickle
def save_pkl(obj, file):
with open(file, "wb") as f:
pickle.dump(obj, f)
def load_pickle(pickle_path):
with open(pickle_path, "rb") as f:
out = pickle.load(f)
return out
def load_pkl(file):
count = 100
while count > 0:
if ... | true | true |
f7fe89ff2c106eb98d907bf2dbfdab13c48c8747 | 2,223 | py | Python | squeezer/onnx/export.py | esceptico/squeezer | 98bc4c7923c6aa3b12ac81444d79392826fc34c6 | [
"MIT"
] | 29 | 2021-11-16T18:50:54.000Z | 2022-03-13T08:18:29.000Z | squeezer/onnx/export.py | esceptico/squeezer | 98bc4c7923c6aa3b12ac81444d79392826fc34c6 | [
"MIT"
] | null | null | null | squeezer/onnx/export.py | esceptico/squeezer | 98bc4c7923c6aa3b12ac81444d79392826fc34c6 | [
"MIT"
] | null | null | null | from logging import getLogger
from typing import Dict, List, Optional, Tuple, Union
import torch
from torch import nn
from torch.onnx import export
logger = getLogger(__name__)
def export_to_onnx(
model: nn.Module,
dummy_input: [Union[Tuple], torch.Tensor],
file,
opset_version: int = 12,
input_n... | 34.2 | 74 | 0.589744 | from logging import getLogger
from typing import Dict, List, Optional, Tuple, Union
import torch
from torch import nn
from torch.onnx import export
logger = getLogger(__name__)
def export_to_onnx(
model: nn.Module,
dummy_input: [Union[Tuple], torch.Tensor],
file,
opset_version: int = 12,
input_n... | true | true |
f7fe8aea28a782debcb6c52ead11ec2710fb20c0 | 23,189 | py | Python | nuitka/tools/specialize/__main__.py | lurid-bogey/Nuitka | 7eca8d66874e08f6d8472ad4e63255a08ad0c3c5 | [
"Apache-2.0"
] | null | null | null | nuitka/tools/specialize/__main__.py | lurid-bogey/Nuitka | 7eca8d66874e08f6d8472ad4e63255a08ad0c3c5 | [
"Apache-2.0"
] | null | null | null | nuitka/tools/specialize/__main__.py | lurid-bogey/Nuitka | 7eca8d66874e08f6d8472ad4e63255a08ad0c3c5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 26.59289 | 92 | 0.60201 |
from __future__ import print_function
import os
from abc import abstractmethod
import jinja2
import nuitka.codegen.OperationCodes
from nuitka.__past__ import getMetaClassBase
from nuitka.tools.quality.autoformat.Autoformat import autoformat
class TypeDescBase(getMetaClassBase("Type")):
t... | true | true |
f7fe8b1e75fed505e11af640bc149b84a1c652b2 | 47,069 | py | Python | mytardis_ngs_ingestor/illumina/models.py | mytardis/mytardis_ngs_ingestor | 5232c688574c8e6cd9a50951c37cd878a09feba3 | [
"BSD-3-Clause"
] | 1 | 2020-11-19T19:10:20.000Z | 2020-11-19T19:10:20.000Z | mytardis_ngs_ingestor/illumina/models.py | mytardis/mytardis_ngs_ingestor | 5232c688574c8e6cd9a50951c37cd878a09feba3 | [
"BSD-3-Clause"
] | 3 | 2017-10-02T03:48:03.000Z | 2020-03-12T23:52:47.000Z | mytardis_ngs_ingestor/illumina/models.py | mytardis/mytardis_ngs_ingestor | 5232c688574c8e6cd9a50951c37cd878a09feba3 | [
"BSD-3-Clause"
] | null | null | null | # Data model generated from ../fixtures/sequencing_facility_schema.json
from mytardis_ngs_ingestor.mytardis_models import MyTardisParameterSet
class IlluminaSequencingRunBase(MyTardisParameterSet):
"""
:type run_id: unicode
:type run_number: float
:type flowcell_id: unicode
:type instrument_id... | 44.615166 | 119 | 0.608362 |
from mytardis_ngs_ingestor.mytardis_models import MyTardisParameterSet
class IlluminaSequencingRunBase(MyTardisParameterSet):
def __init__(self):
super(IlluminaSequencingRunBase, self).__init__()
self.run_id = None
self.run_number = None
... | true | true |
f7fe8c079b89289ce6b4343d8a4e2c41a431580a | 68,217 | py | Python | Python/Version 5.1 (English Real-Time search)/maze51.py | clayfish/maze | 03bad22426d90225eca71d20f16e2da590a22aa2 | [
"MIT"
] | null | null | null | Python/Version 5.1 (English Real-Time search)/maze51.py | clayfish/maze | 03bad22426d90225eca71d20f16e2da590a22aa2 | [
"MIT"
] | null | null | null | Python/Version 5.1 (English Real-Time search)/maze51.py | clayfish/maze | 03bad22426d90225eca71d20f16e2da590a22aa2 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import font
from tkinter import messagebox
from functools import partial
from operator import attrgetter
import webbrowser
import numpy
import random
import math
import os
"""
@author Nikos Kanargias
E-mail: nkana@tee.gr
@version 5.1
The software solves and visualizes the robot moti... | 45.447702 | 134 | 0.538165 | from tkinter import *
from tkinter import font
from tkinter import messagebox
from functools import partial
from operator import attrgetter
import webbrowser
import numpy
import random
import math
import os
class Maze51:
class CreateToolTip(object):
def __init__(self, widget, text='widget info'... | true | true |
f7fe8c1d16ac56938049fc68ef9d8ee45457eee9 | 6,942 | py | Python | clinicaldg/eicu/data.py | MLforHealth/ClinicalDG | 2de4a8e155231f07d80036504a6f49b50004654e | [
"MIT"
] | 18 | 2021-03-23T07:45:56.000Z | 2022-03-29T00:42:04.000Z | clinicaldg/eicu/data.py | MLforHealth/ClinicalDG | 2de4a8e155231f07d80036504a6f49b50004654e | [
"MIT"
] | 2 | 2022-03-20T16:57:28.000Z | 2022-03-22T03:56:46.000Z | clinicaldg/eicu/data.py | MLforHealth/ClinicalDG | 2de4a8e155231f07d80036504a6f49b50004654e | [
"MIT"
] | 1 | 2022-03-17T19:03:15.000Z | 2022-03-17T19:03:15.000Z | import pandas as pd
pd.options.mode.chained_assignment = None
import numpy as np
from clinicaldg.eicu.data_extraction.data_extraction_mortality import data_extraction_mortality
import clinicaldg.eicu.Constants as Constants
from sklearn.preprocessing import StandardScaler, LabelEncoder
from torch.utils.data import Conca... | 49.942446 | 152 | 0.644771 | import pandas as pd
pd.options.mode.chained_assignment = None
import numpy as np
from clinicaldg.eicu.data_extraction.data_extraction_mortality import data_extraction_mortality
import clinicaldg.eicu.Constants as Constants
from sklearn.preprocessing import StandardScaler, LabelEncoder
from torch.utils.data import Conca... | true | true |
f7fe8c4804d16ffd1db3a338967955f15498fe1f | 28,269 | py | Python | src/opencmiss/neon/ui/mainwindow.py | hsorby/neon | 0fcbddfca8baf50d8ecc310a7cb393ffdec88431 | [
"Apache-2.0"
] | null | null | null | src/opencmiss/neon/ui/mainwindow.py | hsorby/neon | 0fcbddfca8baf50d8ecc310a7cb393ffdec88431 | [
"Apache-2.0"
] | 2 | 2016-01-15T04:17:35.000Z | 2016-02-26T04:01:02.000Z | src/opencmiss/neon/ui/mainwindow.py | hsorby/neon | 0fcbddfca8baf50d8ecc310a7cb393ffdec88431 | [
"Apache-2.0"
] | 6 | 2015-11-29T20:57:16.000Z | 2021-06-08T04:02:26.000Z | """
Copyright 2015 University of Auckland
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 agre... | 44.871429 | 170 | 0.718738 | import os.path
from PySide2 import QtCore, QtWidgets
from opencmiss.neon.ui.ui_mainwindow import Ui_MainWindow
from opencmiss.neon.undoredo.commands import CommandEmpty
from opencmiss.neon.ui.views.visualisationview import VisualisationView
from opencmiss.neon.ui.dialogs.aboutdialog import AboutDialog
from opencmiss.... | true | true |
f7fe8c9b0817d1ea9a115995a0048e191acfeb38 | 143 | py | Python | web/frontend/urls.py | Comp-490-SeniorProject/site | 031a1c25a3cc901fa764d408d795ed12dfebdb00 | [
"MIT"
] | null | null | null | web/frontend/urls.py | Comp-490-SeniorProject/site | 031a1c25a3cc901fa764d408d795ed12dfebdb00 | [
"MIT"
] | 38 | 2021-10-12T21:49:57.000Z | 2022-03-29T22:53:26.000Z | web/frontend/urls.py | Comp-490-SeniorProject/site | 031a1c25a3cc901fa764d408d795ed12dfebdb00 | [
"MIT"
] | 1 | 2021-12-07T03:49:49.000Z | 2021-12-07T03:49:49.000Z | from django.urls import path
from web.frontend import views
app_name = "frontend"
urlpatterns = [
path("", views.index, name="index"),
]
| 15.888889 | 40 | 0.699301 | from django.urls import path
from web.frontend import views
app_name = "frontend"
urlpatterns = [
path("", views.index, name="index"),
]
| true | true |
f7fe8ce8eddcdb18d69171a8b4ebc832e2c2dee9 | 10,123 | py | Python | tests/integration/backward_compatible/proxy/ringbuffer_test.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 98 | 2015-12-08T14:26:27.000Z | 2022-03-23T17:44:11.000Z | tests/integration/backward_compatible/proxy/ringbuffer_test.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 396 | 2016-02-23T11:07:55.000Z | 2022-03-31T14:26:34.000Z | tests/integration/backward_compatible/proxy/ringbuffer_test.py | tonytheonlypony/hazelcast-python-client | 3aafeaf2ebc05aee4f2386c62c079db496a7c81f | [
"Apache-2.0"
] | 62 | 2015-12-09T11:20:53.000Z | 2022-01-28T01:30:54.000Z | import os
import time
import unittest
from hazelcast.proxy.ringbuffer import OVERFLOW_POLICY_FAIL, MAX_BATCH_SIZE
from hazelcast.serialization.api import IdentifiedDataSerializable
from tests.base import SingleMemberTestCase
from tests.util import random_string, compare_client_version
CAPACITY = 10
class RingBuffer... | 35.149306 | 94 | 0.681122 | import os
import time
import unittest
from hazelcast.proxy.ringbuffer import OVERFLOW_POLICY_FAIL, MAX_BATCH_SIZE
from hazelcast.serialization.api import IdentifiedDataSerializable
from tests.base import SingleMemberTestCase
from tests.util import random_string, compare_client_version
CAPACITY = 10
class RingBuffer... | true | true |
f7fe8d28e8dc1fb58856177bde8fe5f919326feb | 6,780 | py | Python | bci_framework/framework/widgets/annotations.py | UN-GCPDS/bci-framework- | b51f530967561738dc34752acf6add20cbb02283 | [
"BSD-2-Clause"
] | null | null | null | bci_framework/framework/widgets/annotations.py | UN-GCPDS/bci-framework- | b51f530967561738dc34752acf6add20cbb02283 | [
"BSD-2-Clause"
] | null | null | null | bci_framework/framework/widgets/annotations.py | UN-GCPDS/bci-framework- | b51f530967561738dc34752acf6add20cbb02283 | [
"BSD-2-Clause"
] | null | null | null | """
===========
Annotations
===========
"""
from datetime import datetime
from typing import Optional
from PySide6.QtWidgets import QTableWidgetItem
########################################################################
class Annotations:
"""Widget connected with Kafka to stream messages."""
# -----------... | 45.503356 | 129 | 0.558112 | from datetime import datetime
from typing import Optional
from PySide6.QtWidgets import QTableWidgetItem
t_annotations.setItem(row, 0, item)
item = QTableWidgetItem(f"{duration}")
self.parent_frame.tableWidget_annotations.setItem(row, 1, item)
item = QTableWidgetItem(description)
self... | true | true |
f7fe8e6b1efe67b3a1d0bed83a9cbf8737d68a1d | 2,835 | py | Python | facebook_example/member/models.py | BeshoyAtef/StudentsPortal | 2df13b92ff3bfb84cc4d5aa8fd844339dabf4643 | [
"BSD-3-Clause"
] | null | null | null | facebook_example/member/models.py | BeshoyAtef/StudentsPortal | 2df13b92ff3bfb84cc4d5aa8fd844339dabf4643 | [
"BSD-3-Clause"
] | null | null | null | facebook_example/member/models.py | BeshoyAtef/StudentsPortal | 2df13b92ff3bfb84cc4d5aa8fd844339dabf4643 | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django_facebook.models import FacebookModel, get_user_model
from django_facebook.utils import get_profile_model
import logging
logger = logging.getLogger(__name__)
from ... | 38.835616 | 81 | 0.736508 | from django.conf import settings
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django_facebook.models import FacebookModel, get_user_model
from django_facebook.utils import get_profile_model
import logging
logger = logging.getLogger(__name__)
from ... | true | true |
f7fe905d5e78bb1dbb32471c4cb29305e6d41633 | 5,220 | py | Python | src/lactolyse/analyses/lactate_threshold.py | dblenkus/performance | bae6105812c2f2414d0c10ddd465bf589503f61a | [
"Apache-2.0"
] | 1 | 2020-01-14T20:23:34.000Z | 2020-01-14T20:23:34.000Z | src/lactolyse/analyses/lactate_threshold.py | dblenkus/performance | bae6105812c2f2414d0c10ddd465bf589503f61a | [
"Apache-2.0"
] | 13 | 2018-07-21T06:48:45.000Z | 2019-05-29T20:57:13.000Z | src/lactolyse/analyses/lactate_threshold.py | dblenkus/performance | bae6105812c2f2414d0c10ddd465bf589503f61a | [
"Apache-2.0"
] | null | null | null | """Lactate threshold analysis."""
import logging
import numpy as np
from .base import BaseAnalysis
from .utils import FittedPolynomial
logger = logging.getLogger(__name__)
class LactateThresholdAnalyses(BaseAnalysis):
"""Lactate threshold analysis."""
name = 'lactate_threshold'
template = 'lactate_tre... | 35.753425 | 87 | 0.578544 | import logging
import numpy as np
from .base import BaseAnalysis
from .utils import FittedPolynomial
logger = logging.getLogger(__name__)
class LactateThresholdAnalyses(BaseAnalysis):
name = 'lactate_threshold'
template = 'lactate_treshold.tex'
def _calculate_dmax_context(self, inputs, lac_poly, hr_p... | true | true |
f7fe91bb7fea8e7716c174a498d3d5323bb31a62 | 5,183 | py | Python | recommender6_slopeone.py | nabeeltariq2/res-repo | faa4277b537e1075fa38d79c1a9fa31b0fd8c3af | [
"Apache-2.0"
] | null | null | null | recommender6_slopeone.py | nabeeltariq2/res-repo | faa4277b537e1075fa38d79c1a9fa31b0fd8c3af | [
"Apache-2.0"
] | null | null | null | recommender6_slopeone.py | nabeeltariq2/res-repo | faa4277b537e1075fa38d79c1a9fa31b0fd8c3af | [
"Apache-2.0"
] | null | null | null | # from __future__ import absolute_import, division, print_function, unicode_literals
# from surprise import evaluate, print_perf, dump, Reader, Dataset
#import algorithms from surprise
from surprise import evaluate, print_perf, Reader, Dataset, accuracy
# from surprise import KNNBasic, KNNWithMeans, KNNWithZScore, Al... | 28.016216 | 154 | 0.65985 |
from surprise import evaluate, print_perf, Reader, Dataset, accuracy
import time
start_time = time.time()
from surprise import SlopeOne
import numpy as np
import pandas as pd
from sqlalchemy import create_engine
np.random.seed(101)
from collections import defaultdict
import os, io, sys
from sqlalchemy.orm impo... | true | true |
f7fe92de27e332ed4bde871e61045dabc3d46969 | 957 | py | Python | mmgen/datasets/__init__.py | HXWAndCL/mmgeneration | 9afb1d740bf56a4ecde5064d5bb2a4e2d777638b | [
"Apache-2.0"
] | 1 | 2021-09-29T02:57:18.000Z | 2021-09-29T02:57:18.000Z | mmgen/datasets/__init__.py | HXWAndCL/mmgeneration | 9afb1d740bf56a4ecde5064d5bb2a4e2d777638b | [
"Apache-2.0"
] | null | null | null | mmgen/datasets/__init__.py | HXWAndCL/mmgeneration | 9afb1d740bf56a4ecde5064d5bb2a4e2d777638b | [
"Apache-2.0"
] | null | null | null | from .builder import build_dataloader, build_dataset
from .dataset_wrappers import RepeatDataset
from .grow_scale_image_dataset import GrowScaleImgDataset
from .paired_image_dataset import PairedImageDataset
from .pipelines import (Collect, Compose, Flip, ImageToTensor,
LoadImageFromFile, Normal... | 47.85 | 79 | 0.800418 | from .builder import build_dataloader, build_dataset
from .dataset_wrappers import RepeatDataset
from .grow_scale_image_dataset import GrowScaleImgDataset
from .paired_image_dataset import PairedImageDataset
from .pipelines import (Collect, Compose, Flip, ImageToTensor,
LoadImageFromFile, Normal... | true | true |
f7fe937eb62cc9e180b385fc1e2890b36b572aed | 7,616 | py | Python | tutorials/misc/plot_ecog.py | mehdikuchi/mne-python | 864426c4839bab05fd0d142ee20938c336c0b78e | [
"BSD-3-Clause"
] | null | null | null | tutorials/misc/plot_ecog.py | mehdikuchi/mne-python | 864426c4839bab05fd0d142ee20938c336c0b78e | [
"BSD-3-Clause"
] | null | null | null | tutorials/misc/plot_ecog.py | mehdikuchi/mne-python | 864426c4839bab05fd0d142ee20938c336c0b78e | [
"BSD-3-Clause"
] | null | null | null | """
.. _tut_working_with_ecog:
======================
Working with ECoG data
======================
MNE supports working with more than just MEG and EEG data. Here we show some
of the functions that can be used to facilitate working with
electrocorticography (ECoG) data.
"""
# Authors: Eric Larson <larson.eric.d@gmai... | 39.666667 | 79 | 0.63708 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import mne
from mne.viz import plot_alignment, snapshot_brain_montage
print(__doc__)
misc_path = mne.datasets.misc.data_path()
sample_path = mne.datasets.sample.data_path()
subject = 'sample'
subjec... | true | true |
f7fe93d37af27cc8887be6f6e40a9eb3b5215dc7 | 954 | py | Python | kubernetes_asyncio/test/test_admissionregistration_api.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_admissionregistration_api.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_admissionregistration_api.py | lsst-sqre/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.19.15
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unitt... | 23.85 | 124 | 0.737945 |
from __future__ import absolute_import
import unittest
import kubernetes_asyncio.client
from kubernetes_asyncio.client.api.admissionregistration_api import AdmissionregistrationApi
from kubernetes_asyncio.client.rest import ApiException
class TestAdmissionregistrationApi(unittest.TestCase):
def setUp(sel... | true | true |
f7fe93f298d692c1154a36dc5858a9ef416e0f5f | 6,296 | py | Python | pyfr/integrators/steppers.py | jappa/PyFR | d99120c1db245c7a2a35c72dae51ea72c49efef5 | [
"BSD-3-Clause"
] | null | null | null | pyfr/integrators/steppers.py | jappa/PyFR | d99120c1db245c7a2a35c72dae51ea72c49efef5 | [
"BSD-3-Clause"
] | null | null | null | pyfr/integrators/steppers.py | jappa/PyFR | d99120c1db245c7a2a35c72dae51ea72c49efef5 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from abc import abstractmethod
from pyfr.integrators.base import BaseIntegrator
from pyfr.util import proxylist
class BaseStepper(BaseIntegrator):
def __init__(self, *args, **kwargs):
super(BaseStepper, self).__init__(*args, **kwargs)
backend = self._backend
elem... | 28.233184 | 77 | 0.548761 |
from abc import abstractmethod
from pyfr.integrators.base import BaseIntegrator
from pyfr.util import proxylist
class BaseStepper(BaseIntegrator):
def __init__(self, *args, **kwargs):
super(BaseStepper, self).__init__(*args, **kwargs)
backend = self._backend
elemats = self._system.ele_... | true | true |
f7fe9480e9caa5b2addbc0bbda880e1c1b74575c | 4,336 | py | Python | isi_sdk_8_0/isi_sdk_8_0/models/compatibilities_class_available_available_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_0/isi_sdk_8_0/models/compatibilities_class_available_available_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_0/isi_sdk_8_0/models/compatibilities_class_available_available_item.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 3
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class CompatibilitiesClassAvaila... | 29.903448 | 101 | 0.599631 |
import pprint
import re
import six
class CompatibilitiesClassAvailableAvailableItem(object):
swagger_types = {
'class_1': 'str',
'class_2': 'str'
}
attribute_map = {
'class_1': 'class_1',
'class_2': 'class_2'
}
def __init__(self, class_1=None, class_2=None... | true | true |
f7fe9647502d58cc2c2378dd840d093c46e34c6a | 480 | py | Python | Python/118pascal's_triangle.py | Apocrypse/LeetCode | 3ada2605ce8c8f6dadebf37a30c9c00a0d1ede39 | [
"MIT"
] | 4 | 2020-03-17T03:08:51.000Z | 2022-03-14T17:33:28.000Z | Python/118pascal's_triangle.py | Apocrypse/LeetCode | 3ada2605ce8c8f6dadebf37a30c9c00a0d1ede39 | [
"MIT"
] | null | null | null | Python/118pascal's_triangle.py | Apocrypse/LeetCode | 3ada2605ce8c8f6dadebf37a30c9c00a0d1ede39 | [
"MIT"
] | 3 | 2021-04-29T16:51:02.000Z | 2022-03-19T17:37:56.000Z | class Solution:
def generate(self, numRows):
"""
:type numRows: int
:rtype: List[List[int]]
"""
if not numRows:
return []
pascal = [[1]]
row = 1
while row != numRows:
cur = pascal[-1]
tmp = [1]
for i in r... | 24 | 43 | 0.410417 | class Solution:
def generate(self, numRows):
if not numRows:
return []
pascal = [[1]]
row = 1
while row != numRows:
cur = pascal[-1]
tmp = [1]
for i in range(row-1):
tmp.append(cur[i]+cur[i+1])
tmp.append(1)
... | true | true |
f7fe966c3b3d70911f2c02b9c929b27cbfc3d656 | 7,900 | py | Python | cms/appresolver.py | aleray/django-cms | 9604c580413eadbd746713e27216b33fdb4d9d62 | [
"BSD-3-Clause"
] | 2 | 2016-02-19T04:19:22.000Z | 2016-02-19T04:19:36.000Z | cms/appresolver.py | bhodorog/django-cms | 8b22b400f15b366749101d0041142e5529d5f2d4 | [
"BSD-3-Clause"
] | null | null | null | cms/appresolver.py | bhodorog/django-cms | 8b22b400f15b366749101d0041142e5529d5f2d4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from cms.apphook_pool import apphook_pool
from cms.exceptions import NoHomeFound
from cms.utils.moderator import get_page_queryset
from django.conf import settings
from django.conf.urls.defaults import patterns
from django.contrib.sites.models import Site
from django.core.exceptions import Impr... | 38.349515 | 103 | 0.638101 |
from cms.apphook_pool import apphook_pool
from cms.exceptions import NoHomeFound
from cms.utils.moderator import get_page_queryset
from django.conf import settings
from django.conf.urls.defaults import patterns
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from d... | false | true |
f7fe97ef8ffadbac248437d2b382b73b21f70d7c | 1,459 | py | Python | libweasyl/libweasyl/alembic/versions/eff79a07a88d_use_timestamp_column_for_latest_.py | greysteil/wzl-test | 0f863b9e7c58e5861437618bd590126ca323140c | [
"Apache-2.0"
] | 1 | 2019-02-15T04:21:48.000Z | 2019-02-15T04:21:48.000Z | libweasyl/libweasyl/alembic/versions/eff79a07a88d_use_timestamp_column_for_latest_.py | kfkitsune/wzl-test | 27297ccb42e24d652a29aa82f5a667c7d9a6d8de | [
"Apache-2.0"
] | 254 | 2017-12-23T19:36:43.000Z | 2020-04-14T21:46:13.000Z | libweasyl/libweasyl/alembic/versions/eff79a07a88d_use_timestamp_column_for_latest_.py | greysteil/wzl-test | 0f863b9e7c58e5861437618bd590126ca323140c | [
"Apache-2.0"
] | 1 | 2017-12-23T18:42:16.000Z | 2017-12-23T18:42:16.000Z | """Use TIMESTAMP column for latest submission
Revision ID: eff79a07a88d
Revises: 83e6b2a46191
Create Date: 2017-01-08 22:20:43.814375
"""
# revision identifiers, used by Alembic.
revision = 'eff79a07a88d'
down_revision = '83e6b2a46191'
from alembic import op
import sqlalchemy as sa
import libweasyl
from libweasyl.... | 29.77551 | 130 | 0.708019 |
revision = 'eff79a07a88d'
down_revision = '83e6b2a46191'
from alembic import op
import sqlalchemy as sa
import libweasyl
from libweasyl.legacy import UNIXTIME_OFFSET
def upgrade():
op.alter_column(
'profile',
'latest_submission_time',
new_column_name='latest_submission_time_old',
)... | true | true |
f7fe983d9f3c9724263133f0b77deed272534129 | 1,764 | py | Python | src/main/py/ltprg/game/color/properties/get_stim_embeddings.py | forkunited/ltprg | 4e40d3571d229023df0f845c68643024e04bc202 | [
"MIT"
] | 11 | 2017-08-03T15:42:19.000Z | 2021-02-04T12:43:35.000Z | src/main/py/ltprg/game/color/properties/get_stim_embeddings.py | forkunited/ltprg | 4e40d3571d229023df0f845c68643024e04bc202 | [
"MIT"
] | null | null | null | src/main/py/ltprg/game/color/properties/get_stim_embeddings.py | forkunited/ltprg | 4e40d3571d229023df0f845c68643024e04bc202 | [
"MIT"
] | 1 | 2021-02-04T12:43:37.000Z | 2021-02-04T12:43:37.000Z | from __future__ import division
import numpy as np
import sys
sys.path.append('../../../../../../../../Packages/mungpy/src/main/py/mung/')
import torch
import torch.nn as nn
from torch.autograd import Variable
import time
from data import DataSet
from alexnet import PartialAlexnet, rgb_to_alexnet_input
from colorspace_... | 33.283019 | 76 | 0.707483 | from __future__ import division
import numpy as np
import sys
sys.path.append('../../../../../../../../Packages/mungpy/src/main/py/mung/')
import torch
import torch.nn as nn
from torch.autograd import Variable
import time
from data import DataSet
from alexnet import PartialAlexnet, rgb_to_alexnet_input
from colorspace_... | false | true |
f7fe988d73b3edc4eb10a7f5ae08663502f160ce | 113 | py | Python | lib_secure_monitoring_service/report.py | jfuruness/lib_secure_monitoring_service | 80748c0be4944427e99f9f4c9ccd47a7fab93936 | [
"BSD-3-Clause"
] | null | null | null | lib_secure_monitoring_service/report.py | jfuruness/lib_secure_monitoring_service | 80748c0be4944427e99f9f4c9ccd47a7fab93936 | [
"BSD-3-Clause"
] | null | null | null | lib_secure_monitoring_service/report.py | jfuruness/lib_secure_monitoring_service | 80748c0be4944427e99f9f4c9ccd47a7fab93936 | [
"BSD-3-Clause"
] | null | null | null | from typing import NamedTuple
class Report(NamedTuple):
reporting_asn: int
prefix: str
as_path: list | 18.833333 | 29 | 0.734513 | from typing import NamedTuple
class Report(NamedTuple):
reporting_asn: int
prefix: str
as_path: list | true | true |
f7fe99031f3d741c5489abd7cc781ad091f717b3 | 4,347 | py | Python | quant/app/spread_trading/strategies/statistical_arbitrage_strategy.py | williamquant/quant | a5447a5211ac6dbe3f9515788ecb162b94e61418 | [
"MIT"
] | 1 | 2022-01-05T09:03:23.000Z | 2022-01-05T09:03:23.000Z | quant/app/spread_trading/strategies/statistical_arbitrage_strategy.py | williamquant/quant | a5447a5211ac6dbe3f9515788ecb162b94e61418 | [
"MIT"
] | null | null | null | quant/app/spread_trading/strategies/statistical_arbitrage_strategy.py | williamquant/quant | a5447a5211ac6dbe3f9515788ecb162b94e61418 | [
"MIT"
] | 2 | 2021-12-27T22:52:50.000Z | 2022-01-05T09:03:15.000Z | from quant.trader.utility import BarGenerator, ArrayManager
from quant.app.spread_trading import (
SpreadStrategyTemplate,
SpreadAlgoTemplate,
SpreadData,
OrderData,
TradeData,
TickData,
BarData
)
class StatisticalArbitrageStrategy(SpreadStrategyTemplate):
""""""
author = "用Python... | 24.016575 | 59 | 0.520589 | from quant.trader.utility import BarGenerator, ArrayManager
from quant.app.spread_trading import (
SpreadStrategyTemplate,
SpreadAlgoTemplate,
SpreadData,
OrderData,
TradeData,
TickData,
BarData
)
class StatisticalArbitrageStrategy(SpreadStrategyTemplate):
author = "用Python的交易员"
... | true | true |
f7fe997b27585a66134a2b95f421cc00774696e7 | 3,878 | py | Python | ge_websocket_to_udp.py | bpennypacker/ge_websocket_to_udp | 900dcd78c1f526ed0722590175c2d0f6b2e51cb0 | [
"MIT"
] | null | null | null | ge_websocket_to_udp.py | bpennypacker/ge_websocket_to_udp | 900dcd78c1f526ed0722590175c2d0f6b2e51cb0 | [
"MIT"
] | null | null | null | ge_websocket_to_udp.py | bpennypacker/ge_websocket_to_udp | 900dcd78c1f526ed0722590175c2d0f6b2e51cb0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import aiohttp
import asyncio
from typing import Any, Dict, Tuple
import configparser
import socket
import time
from gekitchen import (
EVENT_ADD_APPLIANCE,
EVENT_APPLIANCE_STATE_CHANGE,
EVENT_APPLIANCE_INITIAL_UPDATE,
EVENT_DISCONNECTED,
ErdApplianceType,
ErdCode,
E... | 30.535433 | 118 | 0.620165 |
import aiohttp
import asyncio
from typing import Any, Dict, Tuple
import configparser
import socket
import time
from gekitchen import (
EVENT_ADD_APPLIANCE,
EVENT_APPLIANCE_STATE_CHANGE,
EVENT_APPLIANCE_INITIAL_UPDATE,
EVENT_DISCONNECTED,
ErdApplianceType,
ErdCode,
ErdCodeType,
ErdOve... | true | true |
f7fe9aad01a1690a720368845f1e56dcab072722 | 965 | py | Python | qiskit/pulse/channels/pulse_channels.py | Sahar2/qiskit-terra | 19fbaeb68f2b279c9748384e919e1d1b006860f2 | [
"Apache-2.0"
] | 22 | 2019-08-15T04:39:15.000Z | 2022-03-06T05:17:04.000Z | qiskit/pulse/channels/pulse_channels.py | Sahar2/qiskit-terra | 19fbaeb68f2b279c9748384e919e1d1b006860f2 | [
"Apache-2.0"
] | 2 | 2020-10-26T07:12:12.000Z | 2021-12-09T16:22:51.000Z | qiskit/pulse/channels/pulse_channels.py | Sahar2/qiskit-terra | 19fbaeb68f2b279c9748384e919e1d1b006860f2 | [
"Apache-2.0"
] | 9 | 2019-09-05T05:33:00.000Z | 2021-10-09T16:04:53.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 21.931818 | 77 | 0.707772 |
from abc import ABCMeta
from .channels import Channel
class PulseChannel(Channel, metaclass=ABCMeta):
pass
class DriveChannel(PulseChannel):
prefix = 'd'
class MeasureChannel(PulseChannel):
prefix = 'm'
class ControlChannel(PulseChannel):
prefix = 'u'
| true | true |
f7fe9b079fcbf300b453522cdb00e7dbf5d3dd39 | 30,168 | py | Python | tests/statisticslearning_tests.py | vishalbelsare/abcpy | 72d0d31ae3fa531b69ea3fef39c96af6628ee76f | [
"BSD-3-Clause-Clear"
] | 89 | 2017-02-23T23:34:52.000Z | 2022-03-25T20:35:17.000Z | tests/statisticslearning_tests.py | vishalbelsare/abcpy | 72d0d31ae3fa531b69ea3fef39c96af6628ee76f | [
"BSD-3-Clause-Clear"
] | 35 | 2017-03-31T13:24:52.000Z | 2022-01-09T11:31:38.000Z | tests/statisticslearning_tests.py | vishalbelsare/abcpy | 72d0d31ae3fa531b69ea3fef39c96af6628ee76f | [
"BSD-3-Clause-Clear"
] | 32 | 2017-03-22T06:27:43.000Z | 2021-09-17T15:50:42.000Z | import unittest
import numpy as np
from abcpy.backends import BackendDummy as Backend
from abcpy.continuousmodels import Normal
from abcpy.continuousmodels import Uniform
from abcpy.statistics import Identity
from abcpy.statisticslearning import Semiautomatic, SemiautomaticNN, TripletDistanceLearning, \
Contrasti... | 66.157895 | 190 | 0.522905 | import unittest
import numpy as np
from abcpy.backends import BackendDummy as Backend
from abcpy.continuousmodels import Normal
from abcpy.continuousmodels import Uniform
from abcpy.statistics import Identity
from abcpy.statisticslearning import Semiautomatic, SemiautomaticNN, TripletDistanceLearning, \
Contrasti... | true | true |
f7fe9be20480f1b08ea8c20cbfbc51b9436b5905 | 2,173 | py | Python | tacker/vnfm/infra_drivers/noop.py | sungbogo28/tacker | a3f0b6d4e9e490ffeb6b3084705f38d962134fff | [
"Apache-2.0"
] | null | null | null | tacker/vnfm/infra_drivers/noop.py | sungbogo28/tacker | a3f0b6d4e9e490ffeb6b3084705f38d962134fff | [
"Apache-2.0"
] | null | null | null | tacker/vnfm/infra_drivers/noop.py | sungbogo28/tacker | a3f0b6d4e9e490ffeb6b3084705f38d962134fff | [
"Apache-2.0"
] | 1 | 2019-01-21T10:57:10.000Z | 2019-01-21T10:57:10.000Z | # Copyright 2013, 2014 Intel Corporation.
# 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
#
# Unles... | 28.592105 | 78 | 0.670502 |
from oslo_log import log as logging
from oslo_utils import uuidutils
from tacker.common import log
from tacker.vnfm.infra_drivers import abstract_driver
LOG = logging.getLogger(__name__)
class VnfNoop(abstract_driver.VnfAbstractDriver):
def __init__(self):
super(VnfNoop, self).__init... | true | true |
f7fe9c52b15e986902a3ba00feebcc2a53eeaf4a | 9,075 | py | Python | test/test_pluginmanager.py | noralsydmp/icetea | b486cdc8e0d2211e118f1f8211aa4d284ca02422 | [
"Apache-2.0"
] | 6 | 2018-08-10T17:11:10.000Z | 2020-04-29T07:05:36.000Z | test/test_pluginmanager.py | noralsydmp/icetea | b486cdc8e0d2211e118f1f8211aa4d284ca02422 | [
"Apache-2.0"
] | 58 | 2018-08-13T08:36:08.000Z | 2021-07-07T08:32:52.000Z | test/test_pluginmanager.py | noralsydmp/icetea | b486cdc8e0d2211e118f1f8211aa4d284ca02422 | [
"Apache-2.0"
] | 7 | 2018-08-10T12:53:18.000Z | 2021-11-08T05:15:42.000Z | # pylint: disable=missing-docstring,protected-access
"""
Copyright 2017 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required b... | 46.06599 | 95 | 0.729366 |
import unittest
import os
import sys
import mock
from icetea_lib.Plugin.PluginManager import PluginManager, PluginException
from icetea_lib.Plugin.plugins.default_plugins import default_plugins
class PMTestcase(unittest.TestCase):
def test_load_defaults(self):
bench = mock.MagicMock(spec=[])
... | true | true |
f7fe9c842b6fde00535088f166a52c9c7725826f | 286 | py | Python | 2021/day_11/test_solution.py | krother/advent_of_code | fd7d5199666b2f3a60c41c6cf24b747322ad88e5 | [
"MIT"
] | 3 | 2021-12-01T09:27:34.000Z | 2022-02-24T23:35:56.000Z | 2021/day_11/test_solution.py | krother/advent_of_code | fd7d5199666b2f3a60c41c6cf24b747322ad88e5 | [
"MIT"
] | null | null | null | 2021/day_11/test_solution.py | krother/advent_of_code | fd7d5199666b2f3a60c41c6cf24b747322ad88e5 | [
"MIT"
] | null | null | null | import pytest
from .solution import solve
INPUT = """5483143223
2745854711
5264556173
6141336146
6357385478
4167524645
2176841721
6882881134
4846848554
5283751526
"""
def test_solve():
assert solve(INPUT) == 1656
def test_solve2():
assert solve(INPUT, 999999999999) == 195
| 12.434783 | 44 | 0.762238 | import pytest
from .solution import solve
INPUT = """5483143223
2745854711
5264556173
6141336146
6357385478
4167524645
2176841721
6882881134
4846848554
5283751526
"""
def test_solve():
assert solve(INPUT) == 1656
def test_solve2():
assert solve(INPUT, 999999999999) == 195
| true | true |
f7fe9cb437273e5169b1c20580e73b1720f0ff50 | 668 | py | Python | components/Actuators/LowLevel/winch.py | Raptacon/Robot-2022 | f59c6a6ebd5779a2fd91181b65cbcd677507ca5d | [
"MIT"
] | 4 | 2022-01-31T14:05:31.000Z | 2022-03-26T14:12:45.000Z | components/Actuators/LowLevel/winch.py | Raptacon/Robot-2022 | f59c6a6ebd5779a2fd91181b65cbcd677507ca5d | [
"MIT"
] | 57 | 2022-01-13T02:41:31.000Z | 2022-03-26T14:50:42.000Z | components/Actuators/LowLevel/winch.py | Raptacon/Robot-2022 | f59c6a6ebd5779a2fd91181b65cbcd677507ca5d | [
"MIT"
] | null | null | null |
class Winch:
compatString = ["teapot"]
motors_winch: dict
def on_enable(self):
"""
Sets up the winch
"""
self.upSpeed = 0
self.winchMotor = self.motors_winch["winchMotor"]
self.logger.info("Lifter Component Created")
def setRaise(self):
"""
... | 20.875 | 64 | 0.546407 |
class Winch:
compatString = ["teapot"]
motors_winch: dict
def on_enable(self):
self.upSpeed = 0
self.winchMotor = self.motors_winch["winchMotor"]
self.logger.info("Lifter Component Created")
def setRaise(self):
self.upSpeed = .5
def setLower(self):
self.u... | true | true |
f7fe9d66d4c64174c063245c6d2cb2a4b7a1596d | 486 | py | Python | tests/conftest.py | Yasti4/python-aioddd | a0731e05a0133bf5636437ceb7625f7deaa100ab | [
"MIT"
] | 4 | 2020-07-28T12:34:02.000Z | 2021-02-11T09:57:20.000Z | tests/conftest.py | Yasti4/python-aioddd | a0731e05a0133bf5636437ceb7625f7deaa100ab | [
"MIT"
] | 2 | 2020-11-19T20:45:53.000Z | 2020-12-25T13:48:08.000Z | tests/conftest.py | ticdenis/python-aiodi | 4ad35145674f5ec0ed6324bec7dd186ab0a8bc33 | [
"MIT"
] | 1 | 2020-11-19T20:39:09.000Z | 2020-11-19T20:39:09.000Z | import sys
from asyncio import AbstractEventLoop, get_event_loop_policy
from unittest.mock import MagicMock
if sys.version_info >= (3, 8):
from unittest.mock import AsyncMock
else:
class AsyncMock(MagicMock):
async def __call__(self, *args, **kwargs):
return super(AsyncMock, self).__call__... | 24.3 | 67 | 0.734568 | import sys
from asyncio import AbstractEventLoop, get_event_loop_policy
from unittest.mock import MagicMock
if sys.version_info >= (3, 8):
from unittest.mock import AsyncMock
else:
class AsyncMock(MagicMock):
async def __call__(self, *args, **kwargs):
return super(AsyncMock, self).__call__... | true | true |
f7fe9e40ca2bd2c5da645db6823f7967d370514f | 12,777 | py | Python | kd_splicing/kd_splicing/helpers.py | konovalovdmitry/catsnap | d5f1d7c37dcee1ad3fee2cdc12a3b44b56f4c63f | [
"MIT"
] | null | null | null | kd_splicing/kd_splicing/helpers.py | konovalovdmitry/catsnap | d5f1d7c37dcee1ad3fee2cdc12a3b44b56f4c63f | [
"MIT"
] | null | null | null | kd_splicing/kd_splicing/helpers.py | konovalovdmitry/catsnap | d5f1d7c37dcee1ad3fee2cdc12a3b44b56f4c63f | [
"MIT"
] | 1 | 2021-09-30T08:06:20.000Z | 2021-09-30T08:06:20.000Z | import os
import uuid
from collections import defaultdict
from itertools import chain
from typing import Dict, List, Mapping, Optional, Tuple
import pandas as pd
from kd_common import excel, logutil, pathutil
from kd_splicing import as_type, blast, database, features, ml, performance, pipeline
from kd_splicing.datas... | 39.435185 | 129 | 0.681146 | import os
import uuid
from collections import defaultdict
from itertools import chain
from typing import Dict, List, Mapping, Optional, Tuple
import pandas as pd
from kd_common import excel, logutil, pathutil
from kd_splicing import as_type, blast, database, features, ml, performance, pipeline
from kd_splicing.datas... | true | true |
f7fe9edce30814d34454bfea14b8ac92cf00915e | 22,646 | py | Python | efficientdet/anchors.py | HyunjiEllenPak/automl | fedf04adf12c5fd11045ea06e2f5c11a5a5490c4 | [
"Apache-2.0"
] | null | null | null | efficientdet/anchors.py | HyunjiEllenPak/automl | fedf04adf12c5fd11045ea06e2f5c11a5a5490c4 | [
"Apache-2.0"
] | null | null | null | efficientdet/anchors.py | HyunjiEllenPak/automl | fedf04adf12c5fd11045ea06e2f5c11a5a5490c4 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2020 Google Research. 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 require... | 38.318105 | 82 | 0.675307 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from absl import logging
import numpy as np
import tensorflow.compat.v1 as tf
import utils
from object_detection import argmax_matcher
from object_detection import box_list
fr... | true | true |
f7fe9f026c543b5570b877a9844e11b56cd87aa7 | 3,898 | py | Python | openGaussBase/testcase/GUC/WAL/Opengauss_Function_Guc_WAL_Case0052.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/WAL/Opengauss_Function_Guc_WAL_Case0052.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/WAL/Opengauss_Function_Guc_WAL_Case0052.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 37.480769 | 84 | 0.651873 |
import unittest
from testcase.utils.CommonSH import CommonSH
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
logger = Logger()
COMMONSH = CommonSH('PrimaryDbUser')
class Guctestcase(unittest.TestCase):
def setUp(self):
logger.info("==Opengauss_Function_Guc_WAL_Case... | true | true |
f7fe9f1fecdc08f89d9fc996cf962b5f9a2c49b5 | 8,623 | py | Python | sympy/physics/quantum/tests/test_cg.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | sympy/physics/quantum/tests/test_cg.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | sympy/physics/quantum/tests/test_cg.py | ovolve/sympy | 0a15782f20505673466b940454b33b8014a25c13 | [
"BSD-3-Clause"
] | 1 | 2018-10-22T09:17:11.000Z | 2018-10-22T09:17:11.000Z | from __future__ import division
from sympy import S, sqrt, Sum, symbols
from sympy.physics.quantum.cg import Wigner3j, Wigner6j, Wigner9j, CG, cg_simp
from sympy.functions.special.tensor_functions import KroneckerDelta
from sympy.utilities.pytest import slow
@slow
def test_cg_simp_add():
j, m1, m1p, m2, m2p = sym... | 48.44382 | 176 | 0.491824 | from __future__ import division
from sympy import S, sqrt, Sum, symbols
from sympy.physics.quantum.cg import Wigner3j, Wigner6j, Wigner9j, CG, cg_simp
from sympy.functions.special.tensor_functions import KroneckerDelta
from sympy.utilities.pytest import slow
@slow
def test_cg_simp_add():
j, m1, m1p, m2, m2p = sym... | true | true |
f7fea1418f16facb361a8885f258c589f1582d5e | 710 | py | Python | tardis/default_settings/localisation.py | keithschulze/mytardis | 8ed3562574ce990d42bfe96133185a82c31c27d4 | [
"Apache-2.0"
] | null | null | null | tardis/default_settings/localisation.py | keithschulze/mytardis | 8ed3562574ce990d42bfe96133185a82c31c27d4 | [
"Apache-2.0"
] | null | null | null | tardis/default_settings/localisation.py | keithschulze/mytardis | 8ed3562574ce990d42bfe96133185a82c31c27d4 | [
"Apache-2.0"
] | null | null | null | USE_TZ = True
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Au... | 33.809524 | 95 | 0.750704 | USE_TZ = True
TIME_ZONE = 'Australia/Melbourne'
LANGUAGE_CODE = 'en-us'
AT = "jS F Y H:i"
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.