hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c28a23818107a2fb8f037a4d3c22862993e338b | 2,062 | py | Python | letters/migrations/0001_initial.py | onhan/free-site | f01de27a3cafd09234cddacfd4ca9705b5b9d6e7 | [
"BSD-3-Clause"
] | 19 | 2018-01-28T14:35:40.000Z | 2020-12-04T03:04:02.000Z | letters/migrations/0001_initial.py | groundupnews/gu | c7179ee3d058c8749d250d681032a76dc8d599d5 | [
"BSD-3-Clause"
] | 8 | 2018-06-02T14:28:28.000Z | 2021-08-06T10:22:37.000Z | letters/migrations/0001_initial.py | onhan/free-site | f01de27a3cafd09234cddacfd4ca9705b5b9d6e7 | [
"BSD-3-Clause"
] | 21 | 2018-02-25T14:07:48.000Z | 2020-05-28T23:10:52.000Z | # Generated by Django 2.1.4 on 2018-12-10 16:17
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('newsroom', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='... | 45.822222 | 186 | 0.594083 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('newsroom', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Letter',
fields=[
(... | true | true |
1c28a25f869dd5efdf173983e056b9729aed8c78 | 1,455 | py | Python | muk_web_utils/models/ir_attachment.py | juazisco/gestion_rifa | bce6b75f17cb5ab2df7e2f7dd5141fc85a1a5bfb | [
"MIT"
] | null | null | null | muk_web_utils/models/ir_attachment.py | juazisco/gestion_rifa | bce6b75f17cb5ab2df7e2f7dd5141fc85a1a5bfb | [
"MIT"
] | null | null | null | muk_web_utils/models/ir_attachment.py | juazisco/gestion_rifa | bce6b75f17cb5ab2df7e2f7dd5141fc85a1a5bfb | [
"MIT"
] | null | null | null | ##########################################################################
#
# Copyright (C) 2018 MuK IT GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version ... | 33.068182 | 77 | 0.584192 | true | true | |
1c28a3afc5efbeb61e26a0e617a66628aaa6060c | 683 | py | Python | tests/ui/sidebar.py | uProxy/1-ufo-management-server | e5d3a9fc704f13d2d0c82fc7cd5ac596c553eca3 | [
"Apache-2.0"
] | 1 | 2018-12-30T11:35:11.000Z | 2018-12-30T11:35:11.000Z | tests/ui/sidebar.py | UWNetworksLab/ufo-management-server | e5d3a9fc704f13d2d0c82fc7cd5ac596c553eca3 | [
"Apache-2.0"
] | null | null | null | tests/ui/sidebar.py | UWNetworksLab/ufo-management-server | e5d3a9fc704f13d2d0c82fc7cd5ac596c553eca3 | [
"Apache-2.0"
] | null | null | null | """Sidebar module to get links for testing."""
from base_driver import BaseDriver
from selenium.webdriver.common.by import By
class Sidebar(BaseDriver):
"""Sidebar action methods and locators."""
# pylint: disable=too-few-public-methods
SIDEBAR = (By.TAG_NAME, 'ufo-sidebar')
HOME_LINK = (By.ID, 'Home')
... | 27.32 | 72 | 0.707174 | from base_driver import BaseDriver
from selenium.webdriver.common.by import By
class Sidebar(BaseDriver):
SIDEBAR = (By.TAG_NAME, 'ufo-sidebar')
HOME_LINK = (By.ID, 'Home')
USERS_LINK = (By.ID, 'Users')
PROXY_SERVERS_LINK = (By.ID, 'Proxy Servers')
SETUP_LINK = (By.ID, 'Setup')
SYNC_NOTIFICATIONS_L... | true | true |
1c28a48863fdb137462b985924a75e54ee81c414 | 9,787 | py | Python | lib/modules/runners.py | RyanLongVA/Metis-Bounty | c29943ee8102349472d485411ea53c3f2fec469e | [
"MIT"
] | null | null | null | lib/modules/runners.py | RyanLongVA/Metis-Bounty | c29943ee8102349472d485411ea53c3f2fec469e | [
"MIT"
] | null | null | null | lib/modules/runners.py | RyanLongVA/Metis-Bounty | c29943ee8102349472d485411ea53c3f2fec469e | [
"MIT"
] | null | null | null | import pdb
# The data models
import models
# The Tasks >> Consists of their runners
import InScopeTextTasks as InScopeTextTasks
# Import the handy database strings
import mysqlfunc
# Importing the Rules
import ProgramRules, GlobalRules
# Multithreading
from multiprocessing.dummy import Pool as ThreadPool
### Runners ... | 37.787645 | 355 | 0.705323 | import pdb
import models
import InScopeTextTasks as InScopeTextTasks
import mysqlfunc
import ProgramRules, GlobalRules
from multiprocessing.dummy import Pool as ThreadPool
it__(self, scope, Type, TaskListString):
self.Type = Type
self.Tasks = []
askListString.split(','):
try:
self.Tasks.append(model... | false | true |
1c28a51412ab784286563ae6cd3be52422add175 | 1,478 | py | Python | framework/util/Xlsx.py | frankzhangv5/pyInterfaceTest | aaaf629993f51f211bf04b55149e97fe17ffb6d8 | [
"MIT"
] | 1 | 2019-08-22T23:01:50.000Z | 2019-08-22T23:01:50.000Z | framework/util/Xlsx.py | frankzhangv5/pyInterfaceTest | aaaf629993f51f211bf04b55149e97fe17ffb6d8 | [
"MIT"
] | 1 | 2021-06-02T00:19:50.000Z | 2021-06-02T00:19:50.000Z | framework/util/Xlsx.py | frankzhangv5/pyInterfaceTest | aaaf629993f51f211bf04b55149e97fe17ffb6d8 | [
"MIT"
] | 1 | 2019-08-29T00:58:40.000Z | 2019-08-29T00:58:40.000Z | # coding=utf-8
import os
from xlrd import open_workbook
class Xlsx:
_instance = None
def __init__(self):
pass
def _get(self, xlsx_path, sheet, colums):
if xlsx_path is None:
return None
if sheet is None:
return None
if colums is None:
... | 23.460317 | 86 | 0.524357 |
import os
from xlrd import open_workbook
class Xlsx:
_instance = None
def __init__(self):
pass
def _get(self, xlsx_path, sheet, colums):
if xlsx_path is None:
return None
if sheet is None:
return None
if colums is None:
return None
... | false | true |
1c28a79c95ade01bbeaebc1f5657c85703ba9895 | 7,521 | py | Python | hddm/tests/test_optimization.py | ccbrain/hddm_upt | 153abccf20633811503aff5467097ad2cc3fa0e7 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | hddm/tests/test_optimization.py | ccbrain/hddm_upt | 153abccf20633811503aff5467097ad2cc3fa0e7 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | hddm/tests/test_optimization.py | ccbrain/hddm_upt | 153abccf20633811503aff5467097ad2cc3fa0e7 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2017-05-19T10:04:11.000Z | 2020-11-13T09:21:43.000Z |
from copy import copy
import itertools
import glob
import os
import unittest
import pymc as pm
import numpy as np
import pandas as pd
import nose
pd.set_printoptions(precision=4)
from nose import SkipTest
import hddm
from hddm.diag import check_model
def add_outliers(data, p_outlier):
"""add outliers to data. ... | 39.171875 | 118 | 0.655897 |
from copy import copy
import itertools
import glob
import os
import unittest
import pymc as pm
import numpy as np
import pandas as pd
import nose
pd.set_printoptions(precision=4)
from nose import SkipTest
import hddm
from hddm.diag import check_model
def add_outliers(data, p_outlier):
data = pd.DataFrame(data)... | true | true |
1c28a7d524bd9352d7aea55121c00580602f1de5 | 2,501 | py | Python | openie/stuffie/utils_stuffie.py | hthuwal/ARC-Challenge | 6b1b2899a4d6e5ea58c7fce0f32d382dbdbfa748 | [
"Apache-2.0"
] | null | null | null | openie/stuffie/utils_stuffie.py | hthuwal/ARC-Challenge | 6b1b2899a4d6e5ea58c7fce0f32d382dbdbfa748 | [
"Apache-2.0"
] | null | null | null | openie/stuffie/utils_stuffie.py | hthuwal/ARC-Challenge | 6b1b2899a4d6e5ea58c7fce0f32d382dbdbfa748 | [
"Apache-2.0"
] | null | null | null | import json
import os
import time
def timeit(function):
def inner(*args, **kwargs):
st = time.time()
out = function(*args, **kwargs)
et = time.time()
time_taken = et - st
unit = "seconds" if time_taken <= 60 else "minutes"
time_taken = time_taken if time_taken <= 60 ... | 31.2625 | 82 | 0.457417 | import json
import os
import time
def timeit(function):
def inner(*args, **kwargs):
st = time.time()
out = function(*args, **kwargs)
et = time.time()
time_taken = et - st
unit = "seconds" if time_taken <= 60 else "minutes"
time_taken = time_taken if time_taken <= 60 ... | true | true |
1c28a81cadb7293d08d7c6b9c7afa408660074a3 | 497 | py | Python | tests/support/settings.py | thedrow/django-password-field | f3a1b641c670cac63e799f756b1eff378a0ad9ff | [
"BSD-3-Clause"
] | 2 | 2018-03-02T12:57:16.000Z | 2019-06-07T20:14:24.000Z | tests/support/settings.py | thedrow/django-password-field | f3a1b641c670cac63e799f756b1eff378a0ad9ff | [
"BSD-3-Clause"
] | null | null | null | tests/support/settings.py | thedrow/django-password-field | f3a1b641c670cac63e799f756b1eff378a0ad9ff | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import django
USE_TZ = True
SECRET_KEY = 'secretkey'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'HOST': ':memory:'
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',... | 19.115385 | 71 | 0.661972 |
import django
USE_TZ = True
SECRET_KEY = 'secretkey'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'HOST': ':memory:'
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'tests.support'
)
PASSWORD_HAS... | true | true |
1c28aa4c47defa211ac4ed2d8d4366a82623a046 | 62 | py | Python | npyscreen/globals.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | 2 | 2015-01-12T14:47:19.000Z | 2018-10-03T09:27:22.000Z | npyscreen/globals.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | null | null | null | npyscreen/globals.py | tescalada/npyscreen-restructure | 0833bbbdec18439182f102d2147f3756fa98aadd | [
"BSD-2-Clause"
] | 1 | 2020-03-20T20:19:33.000Z | 2020-03-20T20:19:33.000Z | # encoding: utf-8
DEBUG = False
DISABLE_RESIZE_SYSTEM = False | 15.5 | 29 | 0.774194 |
DEBUG = False
DISABLE_RESIZE_SYSTEM = False | true | true |
1c28aa941d1d96291d3e7fde98b6f6dc6a8821b4 | 1,111 | py | Python | src/oic/oauth2/exception.py | layoaster/pyoidc | 6b03b8a285c3f4652dea474df4429d8ee6e5298b | [
"Apache-2.0"
] | null | null | null | src/oic/oauth2/exception.py | layoaster/pyoidc | 6b03b8a285c3f4652dea474df4429d8ee6e5298b | [
"Apache-2.0"
] | 1 | 2019-02-08T09:11:49.000Z | 2019-02-08T09:11:49.000Z | src/oic/oauth2/exception.py | layoaster/pyoidc | 6b03b8a285c3f4652dea474df4429d8ee6e5298b | [
"Apache-2.0"
] | 1 | 2019-02-25T10:08:48.000Z | 2019-02-25T10:08:48.000Z | from oic.exception import PyoidcError
__author__ = 'roland'
class HttpError(PyoidcError):
pass
class MissingRequiredAttribute(PyoidcError):
pass
class VerificationError(PyoidcError):
pass
class ResponseError(PyoidcError):
pass
class TimeFormatError(PyoidcError):
pass
class CapabilitiesM... | 14.428571 | 78 | 0.724572 | from oic.exception import PyoidcError
__author__ = 'roland'
class HttpError(PyoidcError):
pass
class MissingRequiredAttribute(PyoidcError):
pass
class VerificationError(PyoidcError):
pass
class ResponseError(PyoidcError):
pass
class TimeFormatError(PyoidcError):
pass
class CapabilitiesM... | true | true |
1c28abc96127a1480eaee7d163df617378a05b96 | 81 | py | Python | application/bridgesystem/hosteddocument.py | Ragora/PyBridge | 146bf8dea53d8af1ec7547cb18e4d373b2af6ec8 | [
"MIT"
] | null | null | null | application/bridgesystem/hosteddocument.py | Ragora/PyBridge | 146bf8dea53d8af1ec7547cb18e4d373b2af6ec8 | [
"MIT"
] | null | null | null | application/bridgesystem/hosteddocument.py | Ragora/PyBridge | 146bf8dea53d8af1ec7547cb18e4d373b2af6ec8 | [
"MIT"
] | null | null | null | """
Hosted document programming.
"""
class HostedDocument(object):
pass
| 11.571429 | 32 | 0.666667 |
class HostedDocument(object):
pass
| true | true |
1c28ada8c2e5c0298d97d1ba003cdb17146601c9 | 3,899 | py | Python | src/configurator.py | mnuyens/forseti2 | 3c6d76ffac2b64d51f03d3922e3b388a4e35f1a8 | [
"Apache-2.0"
] | 1 | 2015-03-07T04:48:53.000Z | 2015-03-07T04:48:53.000Z | src/configurator.py | mnuyens/forseti2 | 3c6d76ffac2b64d51f03d3922e3b388a4e35f1a8 | [
"Apache-2.0"
] | null | null | null | src/configurator.py | mnuyens/forseti2 | 3c6d76ffac2b64d51f03d3922e3b388a4e35f1a8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
configurator.py
Created on Sat Apr 27 12:00:00 2013
@author: kyle
reads from various resource files stored on disk.
sends configs to PiEMOS controller, via channels PiEMOS{n}/Config
these configs contain RFID mappings and the PiEMOS layout configuration.
example ... | 30.700787 | 143 | 0.638882 |
from __future__ import print_function
import argparse
import csv
import lcm
import os
import os.path
import time
from forseti2 import *
import settings
config_dir = '../configs'
team_nums_to_names = {}
team_csv_filename = '../resources/teams.csv'
def init_team_nums():
team_reader = csv.reader(open(team_csv_... | true | true |
1c28ae977015fd2ce3a5a1078c830090f518ce70 | 11,145 | py | Python | tools/python/run_micro.py | zhangzhimin/mace | c28f093d719fd650a4308895cd045c26d0f198f6 | [
"Apache-2.0"
] | 1 | 2021-08-02T12:17:58.000Z | 2021-08-02T12:17:58.000Z | tools/python/run_micro.py | zhangzhimin/mace | c28f093d719fd650a4308895cd045c26d0f198f6 | [
"Apache-2.0"
] | null | null | null | tools/python/run_micro.py | zhangzhimin/mace | c28f093d719fd650a4308895cd045c26d0f198f6 | [
"Apache-2.0"
] | 1 | 2021-08-02T12:18:00.000Z | 2021-08-02T12:18:00.000Z | # Copyright 2020 The MACE 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 applicable la... | 37.399329 | 77 | 0.624136 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import copy
import numpy as np
import shutil
import tempfile
from micro_converter import MicroConverter
from py_proto import mace_pb2
import run_target
from utils import util
from... | true | true |
1c28af0cd9da4129ee6dee095ff353c2d2eea731 | 2,436 | py | Python | simulations/Time-uniform/simulations.py | WannabeSmith/betting-paper-simulations | 00a6d870c5d619add22b9710b9b43bb84df5d0c6 | [
"BSD-3-Clause"
] | null | null | null | simulations/Time-uniform/simulations.py | WannabeSmith/betting-paper-simulations | 00a6d870c5d619add22b9710b9b43bb84df5d0c6 | [
"BSD-3-Clause"
] | null | null | null | simulations/Time-uniform/simulations.py | WannabeSmith/betting-paper-simulations | 00a6d870c5d619add22b9710b9b43bb84df5d0c6 | [
"BSD-3-Clause"
] | null | null | null | import sys
import os
sys.path.append(os.path.relpath("../../"))
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import binom
from scipy.stats import beta
from scipy.stats import multinomial
import matplotlib.cm as cm
from confseq.cs_plots import ConfseqToPlot, DataGeneratingProcess, plot_CSs
from ... | 28 | 75 | 0.574302 | import sys
import os
sys.path.append(os.path.relpath("../../"))
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import binom
from scipy.stats import beta
from scipy.stats import multinomial
import matplotlib.cm as cm
from confseq.cs_plots import ConfseqToPlot, DataGeneratingProcess, plot_CSs
from ... | true | true |
1c28af522eb21fdcb512483bf9a02b9da7a07c10 | 350 | py | Python | secondLargestAnotherTry.py | ucsb-cs8-m17/Lecture13_0906 | 9ac5541a933f5fcc120c86c661c7cad0a1d07106 | [
"MIT"
] | null | null | null | secondLargestAnotherTry.py | ucsb-cs8-m17/Lecture13_0906 | 9ac5541a933f5fcc120c86c661c7cad0a1d07106 | [
"MIT"
] | null | null | null | secondLargestAnotherTry.py | ucsb-cs8-m17/Lecture13_0906 | 9ac5541a933f5fcc120c86c661c7cad0a1d07106 | [
"MIT"
] | null | null | null |
def secondLargest(anIntList):
" return second largest int"
# localCopy is a local variable
# but does it affect anInList
localCopy = anIntList
localCopy.sort()
return localCopy[-2]
def test_secondLargest_1():
assert secondLargest([3,7,2,9,1])==7
def test_secondLargest_2():
assert... | 21.875 | 40 | 0.68 |
def secondLargest(anIntList):
localCopy = anIntList
localCopy.sort()
return localCopy[-2]
def test_secondLargest_1():
assert secondLargest([3,7,2,9,1])==7
def test_secondLargest_2():
assert secondLargest([4,10,2,6])==6
| true | true |
1c28b0219529375020614baf21ac85fd7d264ed9 | 64,611 | py | Python | mindspore/nn/layer/quant.py | huxian123/mindspore | ec5ba10c82bbd6eccafe32d3a1149add90105bc8 | [
"Apache-2.0"
] | null | null | null | mindspore/nn/layer/quant.py | huxian123/mindspore | ec5ba10c82bbd6eccafe32d3a1149add90105bc8 | [
"Apache-2.0"
] | null | null | null | mindspore/nn/layer/quant.py | huxian123/mindspore | ec5ba10c82bbd6eccafe32d3a1149add90105bc8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 46.282951 | 119 | 0.549473 |
from functools import partial
import numpy as np
from mindspore import nn
import mindspore.common.dtype as mstype
from mindspore.ops import operations as P
from mindspore.ops import functional as F
from mindspore.common.parameter import Parameter
from mindspore.common.initializer import initializer
from... | true | true |
1c28b0679058bff377db10517b2053f6a8fd4b99 | 11,157 | py | Python | openrouteservice/directions.py | ricardodani/openrouteservice-py | e8eb1e0ad4e13c810440c087512080b9ecf809b5 | [
"Apache-2.0"
] | 1 | 2020-04-09T21:06:15.000Z | 2020-04-09T21:06:15.000Z | openrouteservice/directions.py | ricardodani/openrouteservice-py | e8eb1e0ad4e13c810440c087512080b9ecf809b5 | [
"Apache-2.0"
] | null | null | null | openrouteservice/directions.py | ricardodani/openrouteservice-py | e8eb1e0ad4e13c810440c087512080b9ecf809b5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014 Google Inc. All rights reserved.
#
# Modifications Copyright (C) 2018 HeiGIT, University of Heidelberg.
#
#
# 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... | 37.820339 | 120 | 0.674106 |
from openrouteservice import deprecation
from openrouteservice.optimization import optimization, Job, Vehicle
import warnings
def directions(client,
coordinates,
profile='driving-car',
format_out=None,
format='json',
prefe... | true | true |
1c28b097cd29fd70bb690a579294c01561ea760d | 1,609 | py | Python | weatherapp/core/tests/unit/test_commandmanager.py | midasinc/weatherapp.core | 583f4687ba706d8159a506e844d7630645f39f07 | [
"MIT"
] | null | null | null | weatherapp/core/tests/unit/test_commandmanager.py | midasinc/weatherapp.core | 583f4687ba706d8159a506e844d7630645f39f07 | [
"MIT"
] | null | null | null | weatherapp/core/tests/unit/test_commandmanager.py | midasinc/weatherapp.core | 583f4687ba706d8159a506e844d7630645f39f07 | [
"MIT"
] | 1 | 2019-01-28T17:22:09.000Z | 2019-01-28T17:22:09.000Z | """ Unit tests for CommandManager class """
import unittest
from weatherapp.core.commandmanager import CommandManager
class AnyCommand:
"""Class for tests"""
pass
class CommandManagerTestCase(unittest.TestCase):
"""Unit test case for command manager"""
def setUp(self):
"""Contain set up i... | 28.732143 | 73 | 0.663766 |
import unittest
from weatherapp.core.commandmanager import CommandManager
class AnyCommand:
pass
class CommandManagerTestCase(unittest.TestCase):
def setUp(self):
self.command_manager = CommandManager()
self.command_manager.add('any', AnyCommand)
def test_add(self):
message ... | true | true |
1c28b10a17b09bf0a10d5b9d2f947fae098db4e4 | 40,103 | py | Python | lib/sqlalchemy/ext/associationproxy.py | seddonym/sqlalchemy | 7405392299492c83e6fa1546d3b36f52042e3c5e | [
"MIT"
] | null | null | null | lib/sqlalchemy/ext/associationproxy.py | seddonym/sqlalchemy | 7405392299492c83e6fa1546d3b36f52042e3c5e | [
"MIT"
] | null | null | null | lib/sqlalchemy/ext/associationproxy.py | seddonym/sqlalchemy | 7405392299492c83e6fa1546d3b36f52042e3c5e | [
"MIT"
] | null | null | null | # ext/associationproxy.py
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Contain the ``AssociationProxy`` class.
The ``AssociationProxy`` is a Py... | 32.263073 | 86 | 0.60796 |
import operator
from .. import exc, orm, util
from ..orm import collections, interfaces
from ..sql import or_
from .. import inspect
def association_proxy(target_collection, attr, **kw):
return AssociationProxy(target_collection, attr, **kw)
ASSOCIATION_PROXY = util.symbol('ASSOCIATION_PROXY')
class As... | true | true |
1c28b207c2d97215d4951b9405fc5e3b709baf3b | 3,937 | py | Python | st2common/st2common/models/db/action.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | null | null | null | st2common/st2common/models/db/action.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 15 | 2021-02-11T22:58:54.000Z | 2021-08-06T18:03:47.000Z | st2common/st2common/models/db/action.py | kkkanil/st2 | 07cd195d7a6e177a37dd019e5c9ab8329259d0fa | [
"Apache-2.0"
] | 1 | 2021-07-10T15:02:29.000Z | 2021-07-10T15:02:29.000Z | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 34.840708 | 80 | 0.710439 |
from __future__ import absolute_import
import mongoengine as me
from st2common import log as logging
from st2common.models.db import MongoDBAccess
from st2common.models.db import stormbase
from st2common.models.db.actionalias import ActionAliasDB
from st2common.models.db.executionstate import ActionExec... | true | true |
1c28b3262c1166a5bd131d93dd3aaea274c13f6b | 322 | py | Python | tests/test.py | mitchute/ES2 | 7fbc818874da504d9e71a6649a2da5f20bb4325a | [
"MIT"
] | null | null | null | tests/test.py | mitchute/ES2 | 7fbc818874da504d9e71a6649a2da5f20bb4325a | [
"MIT"
] | null | null | null | tests/test.py | mitchute/ES2 | 7fbc818874da504d9e71a6649a2da5f20bb4325a | [
"MIT"
] | null | null | null | import unittest
from src.functions import add, get_cp, mult
class TestClass(unittest.TestCase):
def test_add(self):
self.assertEqual(add(1, 1), 2)
def test_mult(self):
self.assertEqual(mult(3, 4), 12)
def test_get_cp(self):
self.assertAlmostEqual(get_cp(20), 4183.99, delta=1E-2... | 20.125 | 63 | 0.667702 | import unittest
from src.functions import add, get_cp, mult
class TestClass(unittest.TestCase):
def test_add(self):
self.assertEqual(add(1, 1), 2)
def test_mult(self):
self.assertEqual(mult(3, 4), 12)
def test_get_cp(self):
self.assertAlmostEqual(get_cp(20), 4183.99, delta=1E-2... | true | true |
1c28b4d99ab3282fa27568ddb2ffff837426abe7 | 19,578 | py | Python | Cryptography/Rotation-Ciphers/pygenere.py | hacky1997/My-Gray-Hacker-Resources | e9b10ac7b0e557a9e624a5a6e761f9af4488d777 | [
"MIT"
] | 14 | 2017-06-14T06:10:07.000Z | 2019-02-22T03:21:15.000Z | Cryptography/Rotation-Ciphers/pygenere.py | rookie-12/My-Gray-Hacker-Resources | e9b10ac7b0e557a9e624a5a6e761f9af4488d777 | [
"MIT"
] | 1 | 2021-04-30T21:19:32.000Z | 2021-04-30T21:19:32.000Z | Cryptography/Rotation-Ciphers/pygenere.py | rookie-12/My-Gray-Hacker-Resources | e9b10ac7b0e557a9e624a5a6e761f9af4488d777 | [
"MIT"
] | 7 | 2015-10-01T09:47:05.000Z | 2022-01-21T14:25:37.000Z | # PyGenere v 0.3
#
# Release Date: 2007-02-16
# Author: Simon Liu <webmonkey at smurfoncrack dot com>
# URL: http://smurfoncrack.com/pygenere
# History and License at end of file
r"""
This library implements the Caesar and Vigenere ciphers, allowing a piece of
plaintext to be encoded using a numeric rotation or an al... | 41.044025 | 80 | 0.599091 |
class Caesar(str):
def encipher(self, shift):
ciphertext = []
for p in self:
if p.isalpha():
ciphertext.append(chr((ord(p) - ord('Aa'[int(p.islower())]) +
shift) % 26 + ord('Aa'[int(p.islower())])))
else:
ciphertext.... | true | true |
1c28b5709acd0bed7d725068f89856479a819ce7 | 7,967 | py | Python | scale/ingest/scan/configuration/json/configuration_v6.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 121 | 2015-11-18T18:15:33.000Z | 2022-03-10T01:55:00.000Z | scale/ingest/scan/configuration/json/configuration_v6.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 1,415 | 2015-12-23T23:36:04.000Z | 2022-01-07T14:10:09.000Z | scale/ingest/scan/configuration/json/configuration_v6.py | kaydoh/scale | 1b6a3b879ffe83e10d3b9d9074835a4c3bf476ee | [
"Apache-2.0"
] | 66 | 2015-12-03T20:38:56.000Z | 2020-07-27T15:28:11.000Z | """Manages the v6 batch configuration schema"""
from __future__ import unicode_literals
import logging
import os
import re
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from ingest.handlers.file_handler import FileHandler
from ingest.handlers.file_rule import FileRule
from ingest.... | 36.049774 | 118 | 0.597339 | from __future__ import unicode_literals
import logging
import os
import re
from jsonschema import validate
from jsonschema.exceptions import ValidationError
from ingest.handlers.file_handler import FileHandler
from ingest.handlers.file_rule import FileRule
from ingest.scan.configuration.scan_configuration import Sca... | true | true |
1c28b724239c8b3605dad77a13b9811449090d0f | 3,584 | py | Python | exemples/exemple-lecteur-fnc-snc.py | aurmarsan/pyturbo | b4f1c6e535b816fbb51b142f7a694aac9ff9b088 | [
"MIT"
] | 1 | 2018-03-23T13:33:23.000Z | 2018-03-23T13:33:23.000Z | exemples/exemple-lecteur-fnc-snc.py | aurmarsan/pyturbo | b4f1c6e535b816fbb51b142f7a694aac9ff9b088 | [
"MIT"
] | null | null | null | exemples/exemple-lecteur-fnc-snc.py | aurmarsan/pyturbo | b4f1c6e535b816fbb51b142f7a694aac9ff9b088 | [
"MIT"
] | null | null | null | import numpy, scipy
import pyturbo as p
######################################
# pour lire un fichier surface SNC
path_snc = "indiquer.snc"
r = p.LecteurSNC(file_path = path_snc)
r.lire_parametres()
r.get_infos_temporelles() # ca affiche des trucs
r.get_infos_variables() # ca affiche d'autres trucs
# on peut lire le... | 44.8 | 139 | 0.729911 | import numpy, scipy
import pyturbo as p
1 le stator. On peut aussi laisse numbloc=None pour lire rotor et stator.
# ici on lit 'p' a la frame temporelle 10. On tourne le rotor pour le placer en position. On ajouter les faces_id qui peuvent
# etre bien pratique pour afficher seulement des morceaux de la surface (hub,... | true | true |
1c28b7270576c8598e3104501ba72b7520ba1642 | 2,148 | py | Python | mac/google-cloud-sdk/lib/surface/recommender/__init__.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | null | null | null | mac/google-cloud-sdk/lib/surface/recommender/__init__.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | null | null | null | mac/google-cloud-sdk/lib/surface/recommender/__init__.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# Copyright 2019 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 requir... | 39.777778 | 78 | 0.781192 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA,
base.ReleaseTrack.BETA)
class Recommender(base.Group):
category = base.API_PLATFOR... | true | true |
1c28b76373ea126f62e0acce3def88a8a0e98544 | 224 | py | Python | day_saint_ksaver.py | webkadiz/olympiad-problems | 620912815904c0f95b91ccd193ca3db0ea20e507 | [
"MIT"
] | null | null | null | day_saint_ksaver.py | webkadiz/olympiad-problems | 620912815904c0f95b91ccd193ca3db0ea20e507 | [
"MIT"
] | null | null | null | day_saint_ksaver.py | webkadiz/olympiad-problems | 620912815904c0f95b91ccd193ca3db0ea20e507 | [
"MIT"
] | null | null | null | beg, end = map(int, input().split())
if end < 1605:
print(0)
elif beg < 1605:
rang = end - 1605
print(rang // 10 + 1)
else:
rang = end - beg
ans = rang // 10 + 1
if beg % 5 == 0:
ans -= 1
print(ans)
| 12.444444 | 36 | 0.508929 | beg, end = map(int, input().split())
if end < 1605:
print(0)
elif beg < 1605:
rang = end - 1605
print(rang // 10 + 1)
else:
rang = end - beg
ans = rang // 10 + 1
if beg % 5 == 0:
ans -= 1
print(ans)
| true | true |
1c28b7c1c900b457a4b55f062b61022e5ce3d743 | 6,594 | py | Python | packnet-sfm/packnet_sfm/utils/load.py | Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING- | 13fac05601efed16ae8b29989aad487e04cd90a7 | [
"MIT"
] | null | null | null | packnet-sfm/packnet_sfm/utils/load.py | Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING- | 13fac05601efed16ae8b29989aad487e04cd90a7 | [
"MIT"
] | null | null | null | packnet-sfm/packnet_sfm/utils/load.py | Fatmangh/VIDEO-ACTION-CLASSIFICATION-USING-PRETAINED-SELF-SUPERVISED-DEPTH-AWARE-DENSE-PREDICTIVE-CODING- | 13fac05601efed16ae8b29989aad487e04cd90a7 | [
"MIT"
] | null | null | null | # Copyright 2020 Toyota Research Institute. All rights reserved.
import importlib
import logging
import os
import warnings
import torch
from inspect import signature
from collections import OrderedDict
import sys
sys.path.append('../packnet-sfm/packnet_sfm/utils')
sys.path.append('../packnet-sfm/configs')
sys.path.... | 30.527778 | 96 | 0.634213 |
import importlib
import logging
import os
import warnings
import torch
from inspect import signature
from collections import OrderedDict
import sys
sys.path.append('../packnet-sfm/packnet_sfm/utils')
sys.path.append('../packnet-sfm/configs')
sys.path.append('../packnet-sfm/packnet_sfm/models')
sys.path.append('../p... | true | true |
1c28b886b71efddda412690d02a2991097e84394 | 2,245 | py | Python | openstack/tests/functional/network/v2/test_rbac_policy.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | 43 | 2018-12-19T08:39:15.000Z | 2021-07-21T02:45:43.000Z | openstack/tests/functional/network/v2/test_rbac_policy.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | 11 | 2019-03-17T13:28:56.000Z | 2020-09-23T23:57:50.000Z | openstack/tests/functional/network/v2/test_rbac_policy.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | 47 | 2018-12-19T05:14:25.000Z | 2022-03-19T15:28:30.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 34.538462 | 75 | 0.641871 |
import uuid
from openstack.network.v2 import network
from openstack.network.v2 import rbac_policy
from openstack.tests.functional import base
class TestRBACPolicy(base.BaseFunctionalTest):
NET_NAME = 'net-' + uuid.uuid4().hex
UPDATE_NAME = uuid.uuid4().hex
ACTION = 'access_as_shared'
OBJ... | true | true |
1c28b8ac26759210343759d4ce8e96e73a113e7b | 6,481 | py | Python | sympy/polys/domains/fractionfield.py | tesseralis/sympy | 0c2f7e06b1a43d25ba93bac65e93f8d5f323be7a | [
"BSD-3-Clause"
] | 1 | 2020-11-17T07:35:20.000Z | 2020-11-17T07:35:20.000Z | sympy/polys/domains/fractionfield.py | tesseralis/sympy | 0c2f7e06b1a43d25ba93bac65e93f8d5f323be7a | [
"BSD-3-Clause"
] | null | null | null | sympy/polys/domains/fractionfield.py | tesseralis/sympy | 0c2f7e06b1a43d25ba93bac65e93f8d5f323be7a | [
"BSD-3-Clause"
] | null | null | null | """Implementation of :class:`FractionField` class. """
from sympy.polys.domains.field import Field
from sympy.polys.domains.compositedomain import CompositeDomain
from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.polys.polyclasses import DMF
from sympy.polys.polyerrors import Generators... | 33.235897 | 94 | 0.573985 |
from sympy.polys.domains.field import Field
from sympy.polys.domains.compositedomain import CompositeDomain
from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.polys.polyclasses import DMF
from sympy.polys.polyerrors import GeneratorsNeeded
from sympy.polys.polyutils import dict_from_basi... | true | true |
1c28b9973a1faf5e55bce35a36a2f269038de169 | 2,431 | py | Python | grs/twseopen.py | toomore/goristock | e61f57f11a626cfbc4afbf66337fd9d1c51e3e71 | [
"MIT"
] | 30 | 2015-02-13T06:30:10.000Z | 2021-03-04T08:01:46.000Z | grs/twseopen.py | toomore/goristock | e61f57f11a626cfbc4afbf66337fd9d1c51e3e71 | [
"MIT"
] | 1 | 2018-08-03T15:08:26.000Z | 2018-08-03T15:08:26.000Z | grs/twseopen.py | toomore/goristock | e61f57f11a626cfbc4afbf66337fd9d1c51e3e71 | [
"MIT"
] | 11 | 2015-02-27T03:55:11.000Z | 2020-07-09T09:36:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2010,2011 Toomore Chiang, http://toomore.net/
#
# 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 wi... | 32.851351 | 79 | 0.648293 |
from cttwt import TWTime
import csv
from datetime import datetime
_CSVFILEPATH = __name__.split('.')[-2]
class twseopen(object):
def __init__(self, time):
if type(TWTime().now) == type(time):
self.twtime = TWTime().now
elif type(TWTime().date) == type(time):
self.twtime = TW... | true | true |
1c28bb3905df34f0cdc6430f6373b04f16d574d2 | 3,643 | py | Python | evaluate.py | Yanshang1991/FastSpeech2 | c289d86c8560ebca8aeca61a62b79b22b9e708e4 | [
"MIT"
] | null | null | null | evaluate.py | Yanshang1991/FastSpeech2 | c289d86c8560ebca8aeca61a62b79b22b9e708e4 | [
"MIT"
] | null | null | null | evaluate.py | Yanshang1991/FastSpeech2 | c289d86c8560ebca8aeca61a62b79b22b9e708e4 | [
"MIT"
] | 1 | 2021-12-08T08:36:24.000Z | 2021-12-08T08:36:24.000Z | import argparse
import os
import torch
import yaml
import torch.nn as nn
from torch.utils.data import DataLoader
from utils.model import get_model, get_vocoder
from utils.tools import to_device, log, synth_one_sample
from model import FastSpeech2Loss
from dataset import Dataset
device = torch.device("... | 30.358333 | 171 | 0.588251 | import argparse
import os
import torch
import yaml
import torch.nn as nn
from torch.utils.data import DataLoader
from utils.model import get_model, get_vocoder
from utils.tools import to_device, log, synth_one_sample
from model import FastSpeech2Loss
from dataset import Dataset
device = torch.device("... | true | true |
1c28bb7051716d6a152e37585ee8458d398d2f64 | 668 | py | Python | twitchwatcher/__init__.py | MOZGIII/twitch | 77a39e8e7b8104717553efeebc05489301eaaf96 | [
"MIT"
] | null | null | null | twitchwatcher/__init__.py | MOZGIII/twitch | 77a39e8e7b8104717553efeebc05489301eaaf96 | [
"MIT"
] | null | null | null | twitchwatcher/__init__.py | MOZGIII/twitch | 77a39e8e7b8104717553efeebc05489301eaaf96 | [
"MIT"
] | null | null | null | import sys
import os
def usage():
"""Print usage info and exit the app"""
print("Usage: %s [stream_name | http://stream_url]" % sys.argv[0])
sys.exit(2)
def normalize_stream_url(stream_url):
"""Makes a twitch stream url from a stream name (leaves urls as is)"""
if stream_url.startswith("http://") ... | 29.043478 | 77 | 0.640719 | import sys
import os
def usage():
print("Usage: %s [stream_name | http://stream_url]" % sys.argv[0])
sys.exit(2)
def normalize_stream_url(stream_url):
if stream_url.startswith("http://") or stream_url.startswith("https://"):
return stream_url
return "http://twitch.tv/%s" % stream_url
def main... | true | true |
1c28bb9c33d61ce9423c8d6144a7008d0f00255c | 1,523 | py | Python | yawast/external/total_size.py | Prodject/yawast | 044309709cf3782de75a35f77297f2d2850d8e1c | [
"BSD-3-Clause"
] | 200 | 2016-02-06T17:14:03.000Z | 2022-03-14T00:50:25.000Z | yawast/external/total_size.py | Prodject/yawast | 044309709cf3782de75a35f77297f2d2850d8e1c | [
"BSD-3-Clause"
] | 341 | 2016-02-06T21:53:47.000Z | 2021-09-27T22:40:25.000Z | yawast/external/total_size.py | Prodject/yawast | 044309709cf3782de75a35f77297f2d2850d8e1c | [
"BSD-3-Clause"
] | 68 | 2016-02-17T08:10:47.000Z | 2021-05-27T23:26:07.000Z | # From: https://github.com/ActiveState/recipe-577504-compute-mem-footprint
# License: MIT
# Copyright: Raymond Hettinger
from collections import deque
from itertools import chain
from sys import getsizeof
def total_size(o, handlers=None):
""" Returns the approximate memory footprint an object and all of its cont... | 32.404255 | 83 | 0.64872 |
from collections import deque
from itertools import chain
from sys import getsizeof
def total_size(o, handlers=None):
if handlers is None:
handlers = {}
dict_handler = lambda d: chain.from_iterable(d.items())
all_handlers = {
tuple: iter,
list: iter,
deque: iter,
... | true | true |
1c28bbd406c03d3e114acd7cb112486f704a73ec | 1,027 | py | Python | tests/conftest.py | armills/aioautomatic | 346666868f35308dd6edd8a1fffb4c4f0d0ba2da | [
"Apache-2.0"
] | 8 | 2017-04-16T01:16:31.000Z | 2019-06-07T07:16:26.000Z | tests/conftest.py | armills/aioautomatic | 346666868f35308dd6edd8a1fffb4c4f0d0ba2da | [
"Apache-2.0"
] | 5 | 2017-04-24T02:33:15.000Z | 2019-10-16T21:30:04.000Z | tests/conftest.py | armills/aioautomatic | 346666868f35308dd6edd8a1fffb4c4f0d0ba2da | [
"Apache-2.0"
] | 4 | 2017-04-24T02:06:27.000Z | 2018-12-11T19:16:26.000Z | """Common fixtures for tests."""
from aioautomatic.client import Client
from aioautomatic.session import Session
import pytest
from tests.common import AsyncMock, SessionMock
@pytest.fixture
def aiohttp_session(event_loop):
"""Create a mock aiohttp session object."""
session = SessionMock()
session.loop ... | 26.333333 | 76 | 0.685492 | from aioautomatic.client import Client
from aioautomatic.session import Session
import pytest
from tests.common import AsyncMock, SessionMock
@pytest.fixture
def aiohttp_session(event_loop):
session = SessionMock()
session.loop = event_loop
yield session
@pytest.fixture
def client(aiohttp_session):
... | true | true |
1c28bc4d3db995a30c9b6346d8cfc55165bb77b7 | 3,951 | py | Python | lib/services/server/ncloud_server/model/get_root_password_server_instance_list_request.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 12 | 2018-11-20T04:30:49.000Z | 2021-11-09T12:34:26.000Z | lib/services/server/ncloud_server/model/get_root_password_server_instance_list_request.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 1 | 2019-01-24T15:56:15.000Z | 2019-05-31T07:56:55.000Z | lib/services/server/ncloud_server/model/get_root_password_server_instance_list_request.py | NaverCloudPlatform/ncloud-sdk-python | 5976dfabd205c615fcf57ac2f0ab67313ee6953c | [
"MIT"
] | 6 | 2018-06-29T03:45:50.000Z | 2022-03-18T01:51:45.000Z | # coding: utf-8
"""
server
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from ncloud_server.model.root_password_server_instance_parameter import RootPasswordServerInstanceParameter # noqa: F401,E501
class GetRootPasswordServer... | 34.356522 | 153 | 0.656796 |
import pprint
import re
import six
from ncloud_server.model.root_password_server_instance_parameter import RootPasswordServerInstanceParameter
class GetRootPasswordServerInstanceListRequest(object):
swagger_types = {
'root_password_server_instance_list': 'list[RootPasswordServerInstanceParamete... | true | true |
1c28bc758e7a30f3302e0f1c676353a83588dcec | 4,886 | py | Python | src/geomagindices/io.py | space-physics/geomag-indices | c989f7df05ac1082f7347cd32cfee7a916e3b30d | [
"MIT"
] | 10 | 2019-07-24T02:15:29.000Z | 2022-03-17T11:40:57.000Z | src/geomagindices/io.py | space-physics/geomag-indices | c989f7df05ac1082f7347cd32cfee7a916e3b30d | [
"MIT"
] | 5 | 2019-10-31T14:10:39.000Z | 2022-03-28T19:10:40.000Z | src/geomagindices/io.py | scivision/geomag-indices | c989f7df05ac1082f7347cd32cfee7a916e3b30d | [
"MIT"
] | 3 | 2020-08-04T12:50:08.000Z | 2021-11-27T18:44:04.000Z | from __future__ import annotations
from pathlib import Path
import pandas
import numpy as np
from datetime import datetime, timedelta
from dateutil.parser import parse
from .web import URLmonthly, URL45dayfcast, URL20yearfcast
from .utils import yeardec2datetime
def load(flist: Path | list[Path]) -> pandas.DataFrame... | 31.522581 | 108 | 0.556897 | from __future__ import annotations
from pathlib import Path
import pandas
import numpy as np
from datetime import datetime, timedelta
from dateutil.parser import parse
from .web import URLmonthly, URL45dayfcast, URL20yearfcast
from .utils import yeardec2datetime
def load(flist: Path | list[Path]) -> pandas.DataFrame... | true | true |
1c28bd0706d84a0680df278adb2d2817dd017b9d | 4,035 | py | Python | datumaro/plugins/accuracy_checker_plugin/details/ac.py | shivam124081/datumaro | 3aa8842a3649ec8e05c0bfe042794823375b812b | [
"MIT"
] | null | null | null | datumaro/plugins/accuracy_checker_plugin/details/ac.py | shivam124081/datumaro | 3aa8842a3649ec8e05c0bfe042794823375b812b | [
"MIT"
] | null | null | null | datumaro/plugins/accuracy_checker_plugin/details/ac.py | shivam124081/datumaro | 3aa8842a3649ec8e05c0bfe042794823375b812b | [
"MIT"
] | null | null | null | # Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
from datumaro.util.tf_util import import_tf
import_tf() # prevent TF loading and potential interpeter crash
from itertools import groupby
from accuracy_checker.adapters import create_adapter
from accuracy_checker.data_readers import DataRepres... | 32.02381 | 87 | 0.657497 |
from datumaro.util.tf_util import import_tf
import_tf()
from itertools import groupby
from accuracy_checker.adapters import create_adapter
from accuracy_checker.data_readers import DataRepresentation
from accuracy_checker.launcher import InputFeeder, create_launcher
from accuracy_checker.postprocessor import P... | true | true |
1c28bdeb67750462bea0906016337e015e5fd358 | 2,872 | py | Python | tests/test_hivemind.py | mccartnm/robx | ee1a2fc6239df170d487ab42c7c350a5272e66a8 | [
"MIT"
] | null | null | null | tests/test_hivemind.py | mccartnm/robx | ee1a2fc6239df170d487ab42c7c350a5272e66a8 | [
"MIT"
] | 2 | 2019-09-08T20:15:11.000Z | 2019-10-04T00:45:58.000Z | tests/test_hivemind.py | mccartnm/hivemind | ee1a2fc6239df170d487ab42c7c350a5272e66a8 | [
"MIT"
] | null | null | null | import os
import sys
import unittest
import argparse
import threading
# Make sure we can import hivemind proper
TEST_BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.dirname(TEST_BASE_DIR))
from hivemind import RootController, _Node
from hivemind.core import log
from hivemind.util import... | 29.010101 | 98 | 0.58461 | import os
import sys
import unittest
import argparse
import threading
TEST_BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.dirname(TEST_BASE_DIR))
from hivemind import RootController, _Node
from hivemind.core import log
from hivemind.util import global_settings
from hivemind.util.misc ... | true | true |
1c28be118ad72c74b9a5bc8dadafca75d996e2e2 | 147 | py | Python | Beecrowd/Tired/infinity_msg.py | nazmul629/OJ-Problem_Solution | cf5e01ab8cf062441bfe901e12d98cbaa1d727f9 | [
"MIT"
] | null | null | null | Beecrowd/Tired/infinity_msg.py | nazmul629/OJ-Problem_Solution | cf5e01ab8cf062441bfe901e12d98cbaa1d727f9 | [
"MIT"
] | null | null | null | Beecrowd/Tired/infinity_msg.py | nazmul629/OJ-Problem_Solution | cf5e01ab8cf062441bfe901e12d98cbaa1d727f9 | [
"MIT"
] | null | null | null | import pyautogui
import time
while True:
time.sleep(5)
pyautogui.typewrite("I Love You ❤️ ")
time.sleep(2)
pyautogui.press('enter') | 21 | 41 | 0.673469 | import pyautogui
import time
while True:
time.sleep(5)
pyautogui.typewrite("I Love You ❤️ ")
time.sleep(2)
pyautogui.press('enter') | true | true |
1c28beb12efb17d79428d82d9b9be5a926eb0de0 | 4,285 | py | Python | tools/spec-collector.py | Maratyszcza/WebRunner | e7cdb0cb9bb36ea033bcc0a4f629e18d8b3a28b2 | [
"BSD-2-Clause"
] | null | null | null | tools/spec-collector.py | Maratyszcza/WebRunner | e7cdb0cb9bb36ea033bcc0a4f629e18d8b3a28b2 | [
"BSD-2-Clause"
] | null | null | null | tools/spec-collector.py | Maratyszcza/WebRunner | e7cdb0cb9bb36ea033bcc0a4f629e18d8b3a28b2 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function, absolute_import
import os
import sys
import argparse
from spec import read_kernel_specification, Kernel, Parameter, Argument
parser = argparse.ArgumentParser(description="WebRunner Kernel Specification Collector")
parser.add_argument(
"--code", dest="... | 34.007937 | 104 | 0.681214 |
from __future__ import print_function, absolute_import
import os
import sys
import argparse
from spec import read_kernel_specification, Kernel, Parameter, Argument
parser = argparse.ArgumentParser(description="WebRunner Kernel Specification Collector")
parser.add_argument(
"--code", dest="code", required=True,... | true | true |
1c28beb7b5ea9b7970ecef93289f4e7459b5d4ab | 2,766 | py | Python | tools/telemetry/telemetry/user_story/user_story_filter.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2019-11-28T10:46:52.000Z | 2019-11-28T10:46:52.000Z | tools/telemetry/telemetry/user_story/user_story_filter.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/telemetry/telemetry/user_story/user_story_filter.py | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2015-03-27T11:15:39.000Z | 2016-08-17T14:19:56.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import re
from telemetry.core import command_line
def HasLabelIn(user_story, labels):
return bool(user_story.labels.intersection(labels)... | 34.148148 | 80 | 0.723427 |
import optparse
import re
from telemetry.core import command_line
def HasLabelIn(user_story, labels):
return bool(user_story.labels.intersection(labels))
class UserStoryFilter(command_line.ArgumentHandlerMixIn):
@classmethod
def AddCommandLineArgs(cls, parser):
group = optparse.OptionGroup(parser, '... | true | true |
1c28bff71382acb0cd426e3761c0b52bb7e08335 | 8,109 | py | Python | sh/run_exp.py | DHunte/CodeT5 | dbdadad6f44566c262e9765e6bdad888b7d45293 | [
"BSD-3-Clause"
] | null | null | null | sh/run_exp.py | DHunte/CodeT5 | dbdadad6f44566c262e9765e6bdad888b7d45293 | [
"BSD-3-Clause"
] | null | null | null | sh/run_exp.py | DHunte/CodeT5 | dbdadad6f44566c262e9765e6bdad888b7d45293 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import argparse
def get_cmd(task, sub_task, model_tag, gpu, data_num, bs, lr, source_length, target_length, patience, epoch, warmup,
model_dir, summary_dir, res_fn, max_steps=None, save_steps=None, log_steps=None):
if max_steps is None:
cmd_str = 'bash exp_with_... | 46.872832 | 123 | 0.582933 |
import os
import argparse
def get_cmd(task, sub_task, model_tag, gpu, data_num, bs, lr, source_length, target_length, patience, epoch, warmup,
model_dir, summary_dir, res_fn, max_steps=None, save_steps=None, log_steps=None):
if max_steps is None:
cmd_str = 'bash exp_with_args.sh %s %s %s %d %... | true | true |
1c28c0a4dd1182c44eacbb4a28d78cd77fdcc115 | 3,242 | py | Python | src/test/python/org/o3project/odenos/remoteobject/transport/test_base_message_transport.py | o3project/odenos | 837d0d3d3c37482e843c40c5eeeac10646e68c65 | [
"Apache-2.0"
] | 26 | 2015-02-18T10:22:50.000Z | 2020-06-18T05:07:54.000Z | src/test/python/org/o3project/odenos/remoteobject/transport/test_base_message_transport.py | o3project/odenos | 837d0d3d3c37482e843c40c5eeeac10646e68c65 | [
"Apache-2.0"
] | 45 | 2015-02-20T00:40:45.000Z | 2021-12-14T21:07:57.000Z | src/test/python/org/o3project/odenos/remoteobject/transport/test_base_message_transport.py | o3project/odenos | 837d0d3d3c37482e843c40c5eeeac10646e68c65 | [
"Apache-2.0"
] | 30 | 2015-02-19T02:00:35.000Z | 2017-02-18T15:28:09.000Z | # -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License... | 32.747475 | 76 | 0.596237 |
from org.o3project.odenos.remoteobject.message.response import Response
from org.o3project.odenos.remoteobject.transport.base_message_transport\
import BaseMessageTransport
import unittest
class RemoteMessageTransportTest(unittest.TestCase):
def setUp(self):
self.target = BaseMessageTransport(
... | true | true |
1c28c0b250b5dcea8efc8fbba6a2501502f8af33 | 48,200 | py | Python | patches_tool/aws_patch/aws_deps/libcloud/test/compute/test_opennebula.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 2 | 2015-06-15T02:16:33.000Z | 2022-02-23T07:10:38.000Z | patches_tool/aws_patch/aws_deps/libcloud/test/compute/test_opennebula.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 7 | 2016-05-13T06:39:45.000Z | 2016-05-20T02:55:31.000Z | patches_tool/aws_patch/aws_deps/libcloud/test/compute/test_opennebula.py | Hybrid-Cloud/badam | 390ad3a6fc03948008f7c04ed2f9fcc8514cc1eb | [
"Apache-2.0"
] | 4 | 2015-11-02T04:02:50.000Z | 2021-05-13T17:06:00.000Z | # Copyright 2002-2009, Distributed Systems Architecture Group, Universidad
# Complutense de Madrid (dsa-research.org)
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyr... | 37.833595 | 79 | 0.575996 |
__docformat__ = 'epytext'
import unittest
import sys
from libcloud.utils.py3 import httplib
from libcloud.compute.base import Node, NodeImage, NodeSize, NodeState
from libcloud.compute.drivers.opennebula import OpenNebulaNodeDriver
from libcloud.compute.drivers.opennebula import OpenNeb... | true | true |
1c28c0b8479014624c60e102a556d83293b71b23 | 1,601 | py | Python | alipay/aop/api/domain/AlipayMarketingCardFormtemplateSetModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayMarketingCardFormtemplateSetModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayMarketingCardFormtemplateSetModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.OpenFormFieldDO import OpenFormFieldDO
class AlipayMarketingCardFormtemplateSetModel(object):
def __init__(self):
self._fields = None
self._temp... | 26.683333 | 73 | 0.607121 |
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.OpenFormFieldDO import OpenFormFieldDO
class AlipayMarketingCardFormtemplateSetModel(object):
def __init__(self):
self._fields = None
self._template_id = None
@property
def fields... | true | true |
1c28c1f05a17616c48c2c9512036ec3b1c90bee5 | 1,783 | py | Python | XNATSlicer/XnatSlicerLib/settings/Settings_View.py | QwaddleMan/XNATSlicer | 5aa06e4f2a578898d34cf0ea703963b9556f2da3 | [
"BSD-3-Clause"
] | 4 | 2016-03-03T08:56:52.000Z | 2021-12-10T21:14:58.000Z | XNATSlicer/XnatSlicerLib/settings/Settings_View.py | keithcallenberg/XNATSlicer | 4a8462b2e81984cc114d25fb2b1c981457a11878 | [
"BSD-3-Clause"
] | null | null | null | XNATSlicer/XnatSlicerLib/settings/Settings_View.py | keithcallenberg/XNATSlicer | 4a8462b2e81984cc114d25fb2b1c981457a11878 | [
"BSD-3-Clause"
] | 5 | 2015-04-22T01:53:40.000Z | 2021-03-29T12:14:32.000Z | __author__ = "Sunil Kumar (kumar.sunil.p@gmail.com)"
__copyright__ = "Copyright 2014, Washington University in St. Louis"
__credits__ = ["Sunil Kumar", "Steve Pieper", "Dan Marcus"]
__license__ = "XNAT Software License Agreement " + \
"(see: http://xnat.org/about/license.php)"
__version__ = "2.1.1"
__main... | 27.015152 | 72 | 0.60516 | __author__ = "Sunil Kumar (kumar.sunil.p@gmail.com)"
__copyright__ = "Copyright 2014, Washington University in St. Louis"
__credits__ = ["Sunil Kumar", "Steve Pieper", "Dan Marcus"]
__license__ = "XNAT Software License Agreement " + \
"(see: http://xnat.org/about/license.php)"
__version__ = "2.1.1"
__main... | true | true |
1c28c1f144372b74db75af034c1a5c109cdc8cea | 92,810 | py | Python | pennylane/ops/qubit/parametric_ops.py | MoritzWillmann/pennylane | 2b07d22cfcc6406ba28e5c647062340b240a4ee5 | [
"Apache-2.0"
] | null | null | null | pennylane/ops/qubit/parametric_ops.py | MoritzWillmann/pennylane | 2b07d22cfcc6406ba28e5c647062340b240a4ee5 | [
"Apache-2.0"
] | null | null | null | pennylane/ops/qubit/parametric_ops.py | MoritzWillmann/pennylane | 2b07d22cfcc6406ba28e5c647062340b240a4ee5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 34.348631 | 182 | 0.588105 |
import functools
import math
from operator import matmul
import numpy as np
import pennylane as qml
from pennylane.operation import AnyWires, Operation
from pennylane.ops.qubit.non_parametric_ops import PauliX, PauliY, PauliZ, Hadamard
from pennylane.operation import expand_matrix
from pennylane.utils ... | true | true |
1c28c26dc1496f965dbfc961b7c9c2bb8d369ebd | 909 | py | Python | RPi/Python/Pi_Serial.py | UdayanSinha/Code_Blocks | 43c010dcfb587942b6e6f8ba72b93862042afa1d | [
"MIT"
] | 3 | 2016-10-30T05:54:44.000Z | 2021-05-17T20:24:42.000Z | RPi/Python/Pi_Serial.py | UdayanSinha/Code_Blocks | 43c010dcfb587942b6e6f8ba72b93862042afa1d | [
"MIT"
] | null | null | null | RPi/Python/Pi_Serial.py | UdayanSinha/Code_Blocks | 43c010dcfb587942b6e6f8ba72b93862042afa1d | [
"MIT"
] | 1 | 2018-10-04T08:20:25.000Z | 2018-10-04T08:20:25.000Z | import serial
from time import sleep
#setup serial comm
port="/dev/ttyACM0" #serial port
serial_arduino=serial.Serial(port, 9600) #start serial comm@9600bps
serial_arduino.flushInput() #clear i/p buffer
try:
while True:
if(serial_arduino.inWaiting()>0): #chec... | 45.45 | 128 | 0.645765 | import serial
from time import sleep
port="/dev/ttyACM0"
serial_arduino=serial.Serial(port, 9600)
serial_arduino.flushInput()
try:
while True:
if(serial_arduino.inWaiting()>0):
input=serial_arduino.readline()
print(input) ... | true | true |
1c28c27b1521d9b4a5433301d4dd213cf92c7796 | 2,923 | py | Python | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/10_features/numtrees_20/rule_15.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/10_features/numtrees_20/rule_15.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/10_features/numtrees_20/rule_15.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Education, obj[4]: Occupation, obj[5]: Bar, obj[6]: Coffeehouse, obj[7]: Restaurant20to50, obj[8]: Direction_same, obj[9]: Distance
# {"feature": "Passanger", "instances": 51, "metric_value": 0.8479, "depth": 1}
if obj[0]<=1:
# {"featu... | 35.216867 | 212 | 0.545672 | def findDecision(obj):
if obj[0]<=1:
if obj[4]<=7:
if obj[7]>0.0:
if obj[2]>0:
if obj[3]>0:
if obj[9]<=1:
if obj[1]<=0:
if obj[5]<=0.0:
return 'False'
elif obj[5]>0.0:
return 'True'
else: return 'True'
... | true | true |
1c28c37d8224373ff2f35c14791d856de1a07c96 | 1,237 | py | Python | python/advanced_sw/res_code/scrap2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/advanced_sw/res_code/scrap2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/advanced_sw/res_code/scrap2.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | '''
Note :: some songs donot have JSON, cannot be downloaded!
__author__ : Jimut Bahan Pal
__date__ : June 11 2018
'''
import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import re
# Ignore SSL certificate errors
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx... | 24.74 | 94 | 0.703314 | import urllib.request, urllib.parse, urllib.error
from bs4 import BeautifulSoup
import ssl
import re
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
id1 = input('Enter the song id :- ')
url = 'https://secure.hungama.com/newTwitter_Audio/audio/index-g.php?songid='+str... | true | true |
1c28c4180fcdda091a41e784b624754434663ffc | 3,848 | py | Python | deepcell/utils/export_utils.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | deepcell/utils/export_utils.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | deepcell/utils/export_utils.py | jackstellwagen/deepcell-tf | d9326b8aceb2f25637e0d3934646da8f6a9f9539 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2019 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... | 38.48 | 91 | 0.723753 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import tensorflow as tf
from tensorflow.python.keras import backend as K
from tensorflow.python.saved_model import tag_constants
from tensorflow.python.saved_model import si... | true | true |
1c28c545acf2bc5590f57cb38c060c37f680a383 | 1,659 | py | Python | dojango/data/modelstore/treestore.py | ofirr/dojango | 9856ca4a0194f59a5fe41cc32739e36eaa1f4bc3 | [
"BSD-3-Clause"
] | 1 | 2016-12-27T09:46:02.000Z | 2016-12-27T09:46:02.000Z | dojango/data/modelstore/treestore.py | ofirr/dojango | 9856ca4a0194f59a5fe41cc32739e36eaa1f4bc3 | [
"BSD-3-Clause"
] | null | null | null | dojango/data/modelstore/treestore.py | ofirr/dojango | 9856ca4a0194f59a5fe41cc32739e36eaa1f4bc3 | [
"BSD-3-Clause"
] | null | null | null | from .stores import Store
from .fields import StoreField
from .methods import BaseMethod
class ChildrenMethod(BaseMethod):
""" A method proxy that will resolve the children
of a model that has a tree structure.
"django-treebeard" and "django-mptt" both attach a get_children method
to the mo... | 37.704545 | 89 | 0.644967 | from .stores import Store
from .fields import StoreField
from .methods import BaseMethod
class ChildrenMethod(BaseMethod):
def get_value(self):
store = self.field.proxied_args['StoreArg']
obj = self.field.proxied_args['ObjectArg']
ret = []
if hasattr(obj, "get_children"):
... | true | true |
1c28c6ae80ad89da2c7346fa0b5411d02705991b | 879 | py | Python | tests/test_settings.py | jjacob7734/incubator-sdap-ningesterpy | b26a22c75b288a524745787f1c8db02a377abc2e | [
"Apache-2.0"
] | 3 | 2018-08-29T04:55:12.000Z | 2021-11-10T19:37:17.000Z | tests/test_settings.py | jjacob7734/incubator-sdap-ningesterpy | b26a22c75b288a524745787f1c8db02a377abc2e | [
"Apache-2.0"
] | 2 | 2018-08-28T15:27:22.000Z | 2020-02-06T00:56:33.000Z | tests/test_settings.py | jjacob7734/incubator-sdap-ningesterpy | b26a22c75b288a524745787f1c8db02a377abc2e | [
"Apache-2.0"
] | 9 | 2018-01-23T01:14:49.000Z | 2021-11-10T19:37:05.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 43.95 | 74 | 0.773606 |
SERVER_NAME = '127.0.0.1:0'
ENV = 'development'
PORT_FILE = 'current_port'
CREATE_PORT_FILE = True
| true | true |
1c28c884e51da67e55970095116b1d20bfeef6bf | 1,504 | py | Python | jesse/indicators/macdext.py | leaiannotti/jesse | 564c54845774891ff3b5a8d3c02cc7cea890ac54 | [
"MIT"
] | 5 | 2021-05-21T07:39:16.000Z | 2021-11-17T11:08:41.000Z | jesse/indicators/macdext.py | leaiannotti/jesse | 564c54845774891ff3b5a8d3c02cc7cea890ac54 | [
"MIT"
] | null | null | null | jesse/indicators/macdext.py | leaiannotti/jesse | 564c54845774891ff3b5a8d3c02cc7cea890ac54 | [
"MIT"
] | 2 | 2021-05-21T10:14:53.000Z | 2021-05-27T04:39:51.000Z | from collections import namedtuple
import numpy as np
from jesse.helpers import get_candle_source
from jesse.helpers import slice_candles
from jesse.indicators.ma import ma
MACDEXT = namedtuple('MACDEXT', ['macd', 'signal', 'hist'])
def macdext(candles: np.ndarray, fast_period: int = 12, fast_matype: int = 0, slow... | 35.809524 | 148 | 0.695479 | from collections import namedtuple
import numpy as np
from jesse.helpers import get_candle_source
from jesse.helpers import slice_candles
from jesse.indicators.ma import ma
MACDEXT = namedtuple('MACDEXT', ['macd', 'signal', 'hist'])
def macdext(candles: np.ndarray, fast_period: int = 12, fast_matype: int = 0, slow... | true | true |
1c28c8ea47b77c28ac4ee6b8f2d0058920a385d0 | 364 | py | Python | virtualfish/test/conftest.py | szaydel/virtualfish | ae5873eec445558dfb5fb690b42e2d3355a49453 | [
"MIT"
] | 550 | 2015-01-07T19:36:44.000Z | 2019-04-30T08:22:04.000Z | virtualfish/test/conftest.py | szaydel/virtualfish | ae5873eec445558dfb5fb690b42e2d3355a49453 | [
"MIT"
] | 102 | 2015-01-01T11:17:53.000Z | 2019-04-12T16:17:59.000Z | virtualfish/test/conftest.py | szaydel/virtualfish | ae5873eec445558dfb5fb690b42e2d3355a49453 | [
"MIT"
] | 69 | 2015-01-13T23:25:28.000Z | 2019-03-24T14:00:16.000Z | import pytest
from .repl import Fish
from ..loader import load
from os import mkdir, path
@pytest.fixture
def f():
return Fish()
@pytest.fixture
def vf(f):
mkdir(path.join(f.homedir, ".virtualenvs"))
f.run("\n".join(load()))
return f
@pytest.fixture
def vf_active(vf):
vf.run("vf new myenv")
... | 15.166667 | 47 | 0.656593 | import pytest
from .repl import Fish
from ..loader import load
from os import mkdir, path
@pytest.fixture
def f():
return Fish()
@pytest.fixture
def vf(f):
mkdir(path.join(f.homedir, ".virtualenvs"))
f.run("\n".join(load()))
return f
@pytest.fixture
def vf_active(vf):
vf.run("vf new myenv")
... | true | true |
1c28c8fa9b14c3397bae844111572061431ee6ad | 21,658 | py | Python | features/steps/steps.py | gregr/translator-testing-framework | 75f4259184d8aa5fbe5bc686ca7bbf051bea3560 | [
"BSD-3-Clause"
] | null | null | null | features/steps/steps.py | gregr/translator-testing-framework | 75f4259184d8aa5fbe5bc686ca7bbf051bea3560 | [
"BSD-3-Clause"
] | null | null | null | features/steps/steps.py | gregr/translator-testing-framework | 75f4259184d8aa5fbe5bc686ca7bbf051bea3560 | [
"BSD-3-Clause"
] | null | null | null | import jsonpath_rw
import logging
import requests
import json
import pandas as pd
from behave import given, when, then, use_step_matcher
from contextlib import closing
from reasoner_diff.test_robokop import answer as robokop_answer
from reasoner_diff.test_robokop import question as robokop_question
from reasoner_diff.... | 34.6528 | 120 | 0.649644 | import jsonpath_rw
import logging
import requests
import json
import pandas as pd
from behave import given, when, then, use_step_matcher
from contextlib import closing
from reasoner_diff.test_robokop import answer as robokop_answer
from reasoner_diff.test_robokop import question as robokop_question
from reasoner_diff.... | true | true |
1c28c95f3a2dc9b3bb3bec119d939564c59338d2 | 30,126 | py | Python | src/transformers/modelcard.py | djroxx2000/transformers | 77770ec79883343d32051cfb6a04f64523cd8df1 | [
"Apache-2.0"
] | 723 | 2020-07-16T13:02:25.000Z | 2022-03-31T21:03:55.000Z | src/transformers/modelcard.py | Hecim1984/transformers | 8e908c8c74f556a82534f4cf1e7a1b4f7b55d24c | [
"Apache-2.0"
] | 170 | 2020-07-16T14:39:11.000Z | 2022-03-31T13:02:11.000Z | src/transformers/modelcard.py | Hecim1984/transformers | 8e908c8c74f556a82534f4cf1e7a1b4f7b55d24c | [
"Apache-2.0"
] | 131 | 2020-07-16T14:38:16.000Z | 2022-03-29T19:43:18.000Z | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 39.796565 | 148 | 0.645788 |
import copy
import json
import os
import warnings
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
import requests
import yaml
from huggingface_hub import HfApi
from . import __version__
from .file_utils import (
CONFIG_NAME,
MODEL_... | true | true |
1c28c9c14d886f417107614e37e640811c6acfd1 | 5,327 | py | Python | trustybrowser/Statistics.py | coco673/TrustyBrowser | e88f09c0e7899d53eac266f9c83d2f8949303e0f | [
"Beerware"
] | null | null | null | trustybrowser/Statistics.py | coco673/TrustyBrowser | e88f09c0e7899d53eac266f9c83d2f8949303e0f | [
"Beerware"
] | null | null | null | trustybrowser/Statistics.py | coco673/TrustyBrowser | e88f09c0e7899d53eac266f9c83d2f8949303e0f | [
"Beerware"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
import threading
import json
import logging
class Statistics(object):
""" Classe pour la génération de rapports statistiques sur les
implémentations auditées.
"""
def __init__(self, database, timer):
# Verrou sur le contenu du rapport
self.__l... | 34.367742 | 79 | 0.592078 |
import threading
import json
import logging
class Statistics(object):
def __init__(self, database, timer):
self.__lock = threading.Lock()
self.__writePending = False
self.__reports = {}
self.__charts = []
self.__ren... | true | true |
1c28cb62eb99272ce274d9732ba98bd5b24037d9 | 28,870 | py | Python | env/Lib/site-packages/plotly/graph_objs/layout/_coloraxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 7 | 2022-01-16T12:28:16.000Z | 2022-03-04T15:31:45.000Z | env/Lib/site-packages/plotly/graph_objs/layout/_coloraxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 14 | 2021-10-20T23:33:47.000Z | 2021-12-21T04:50:37.000Z | env/Lib/site-packages/plotly/graph_objs/layout/_coloraxis.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Coloraxis(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout"
_path_str = "layout.coloraxis"
_valid_props = {
"autocolorscale",
... | 41.361032 | 87 | 0.527225 | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Coloraxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout"
_path_str = "layout.coloraxis"
_valid_props = {
"autocolorscale",
"cauto",
"cmax",
"cm... | true | true |
1c28cbf0fa20270abd17c96ab7d4678b2b34d1d1 | 163 | py | Python | src/parsing/admin.py | MichaelNest/JobParser | d60a5bdfa505a201b3a6d98d52abc19edaa91e9f | [
"Apache-2.0"
] | null | null | null | src/parsing/admin.py | MichaelNest/JobParser | d60a5bdfa505a201b3a6d98d52abc19edaa91e9f | [
"Apache-2.0"
] | null | null | null | src/parsing/admin.py | MichaelNest/JobParser | d60a5bdfa505a201b3a6d98d52abc19edaa91e9f | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import City, Language, Vacancy
admin.site.register(City)
admin.site.register(Language)
admin.site.register(Vacancy)
| 23.285714 | 43 | 0.815951 | from django.contrib import admin
from .models import City, Language, Vacancy
admin.site.register(City)
admin.site.register(Language)
admin.site.register(Vacancy)
| true | true |
1c28ccb20a520afdc809120f0017882b681fd400 | 3,030 | py | Python | python3-virtualenv/Lib/python3.6/site-packages/alembic/testing/util.py | LindaNayeli104/mlh-orientation-hackathon-project | d86b58f76721a9d5f3374399bfc6d3b1445d16ca | [
"MIT"
] | null | null | null | python3-virtualenv/Lib/python3.6/site-packages/alembic/testing/util.py | LindaNayeli104/mlh-orientation-hackathon-project | d86b58f76721a9d5f3374399bfc6d3b1445d16ca | [
"MIT"
] | null | null | null | python3-virtualenv/Lib/python3.6/site-packages/alembic/testing/util.py | LindaNayeli104/mlh-orientation-hackathon-project | d86b58f76721a9d5f3374399bfc6d3b1445d16ca | [
"MIT"
] | 1 | 2021-06-20T19:28:37.000Z | 2021-06-20T19:28:37.000Z | # testing/util.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import types
def flag_combinations(*combinations):
"""A facade arou... | 28.055556 | 74 | 0.592739 |
import types
def flag_combinations(*combinations):
from sqlalchemy.testing import config
keys = set()
for d in combinations:
keys.update(d)
keys = sorted(keys)
return config.combinations(
*[
("_".join(k for k in keys if d.get(k, False)),)
... | true | true |
1c28cdeb2ce9697c64de4444b01d79cd465bb3f1 | 2,777 | py | Python | multiagent/teoretoc_results.py | NaumO4/multiagent-particle-envs | 3abf895e97c9a1b003bf324fc4d36a4c8d89d8f6 | [
"MIT"
] | null | null | null | multiagent/teoretoc_results.py | NaumO4/multiagent-particle-envs | 3abf895e97c9a1b003bf324fc4d36a4c8d89d8f6 | [
"MIT"
] | null | null | null | multiagent/teoretoc_results.py | NaumO4/multiagent-particle-envs | 3abf895e97c9a1b003bf324fc4d36a4c8d89d8f6 | [
"MIT"
] | null | null | null | import argparse
import numpy as np
import os
import utilities
from multiagent.environment import MultiAgentEnv
from multiagent.scenarios.open_1_1_pursuit_know_vel import Scenario
from multiagent.simple_agents import StayAgent, ToPointAgent,StayForceAgent, VectorAgent
from multiagent.ddpg_agent import DDPGAgent
import ... | 42.075758 | 100 | 0.745049 | import argparse
import numpy as np
import os
import utilities
from multiagent.environment import MultiAgentEnv
from multiagent.scenarios.open_1_1_pursuit_know_vel import Scenario
from multiagent.simple_agents import StayAgent, ToPointAgent,StayForceAgent, VectorAgent
from multiagent.ddpg_agent import DDPGAgent
import ... | true | true |
1c28cdfb769263bb72d2d84d7ef1db5bd161cf1e | 13,792 | py | Python | celery/local.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | 1 | 2015-12-02T17:12:09.000Z | 2015-12-02T17:12:09.000Z | celery/local.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | null | null | null | celery/local.py | stratoukos/celery | da9c0bad1f52515a70ae28d48abddbf42571a39f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
celery.local
~~~~~~~~~~~~
This module contains critical utilities that
needs to be loaded as soon as possible, and that
shall not load any third party modules.
Parts of this module is Copyright by Werkzeug Team.
:copyright: (c) 2009 - 2012 by Ask Solem.
:li... | 33.153846 | 78 | 0.632396 |
from __future__ import absolute_import
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from dummy_thread import get_ident
def try_import(module, default=None):
from importlib import import_module
... | true | true |
1c28ce51801e439769f69e69db3050ed75fe8135 | 4,279 | py | Python | lite/tests/unittest_py/rpc_service/server.py | zhupengyang/Paddle-Lite | c8d77d38c5586a98a3ffaa0a87d4a3cd0aa42755 | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/rpc_service/server.py | zhupengyang/Paddle-Lite | c8d77d38c5586a98a3ffaa0a87d4a3cd0aa42755 | [
"Apache-2.0"
] | null | null | null | lite/tests/unittest_py/rpc_service/server.py | zhupengyang/Paddle-Lite | c8d77d38c5586a98a3ffaa0a87d4a3cd0aa42755 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 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... | 40.367925 | 136 | 0.641505 |
import rpyc
import os
import shutil
from rpyc.utils.server import ThreadedServer
from paddlelite.lite import *
rpyc.core.protocol.DEFAULT_CONFIG['allow_pickle'] = True
def ParsePlaceInfo(place_str):
infos = ''.join(place_str.split()).split(",")
if len(infos) == 1 :
if infos[0] in Targe... | true | true |
1c28ced8571cc55e9948c851611294c09bc86f73 | 525 | py | Python | sdk/python/pulumi_azure_native/alertsmanagement/v20200804preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/alertsmanagement/v20200804preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/alertsmanagement/v20200804preview/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'HealthAlertsNamespace',
'HealthStateName',
]
class HealthAlertsNamespace(str, Enum):
"""
specifie... | 20.192308 | 80 | 0.655238 |
from enum import Enum
__all__ = [
'HealthAlertsNamespace',
'HealthStateName',
]
class HealthAlertsNamespace(str, Enum):
GUEST_VM_HEALTH = "GuestVmHealth"
class HealthStateName(str, Enum):
WARNING = "Warning"
CRITICAL = "Critical"
| true | true |
1c28d04649748b222e465a41de328eb2d4a1e568 | 2,143 | py | Python | xhtools.py | nxihe/xhtools | 6cdebc576fe6d89f69a4ef8c5cfb23cd7036ab6c | [
"Apache-2.0"
] | null | null | null | xhtools.py | nxihe/xhtools | 6cdebc576fe6d89f69a4ef8c5cfb23cd7036ab6c | [
"Apache-2.0"
] | null | null | null | xhtools.py | nxihe/xhtools | 6cdebc576fe6d89f69a4ef8c5cfb23cd7036ab6c | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
class Xhtools:
'''
npproduct:求两个一维数组的笛卡尔积
threesigmod:根据3Sigma法则求异常值
numericoutlier:箱线图法求异常值
cutbin:自定义分箱,woe、iv值计算
'''
def __init__(self):
return None
def npproduct(self,array1,array2):
if len(array1) == len(array2):
... | 40.433962 | 95 | 0.581428 | import pandas as pd
import numpy as np
class Xhtools:
def __init__(self):
return None
def npproduct(self,array1,array2):
if len(array1) == len(array2):
return np.transpose([np.repeat(array1, len(array1)), np.tile(array2, len(array2))])
else:
return 'array1、a... | true | true |
1c28d1db0f73fbca89d31707a52c23a5eaaecc4f | 1,129 | py | Python | memcache_server/users/tests/test_forms.py | hrabryi/django-vue-memcached-server | 8858a7f4a6ce9bc05dc7f3d2fe5b65ca3ceea098 | [
"MIT"
] | null | null | null | memcache_server/users/tests/test_forms.py | hrabryi/django-vue-memcached-server | 8858a7f4a6ce9bc05dc7f3d2fe5b65ca3ceea098 | [
"MIT"
] | null | null | null | memcache_server/users/tests/test_forms.py | hrabryi/django-vue-memcached-server | 8858a7f4a6ce9bc05dc7f3d2fe5b65ca3ceea098 | [
"MIT"
] | null | null | null | import pytest
from memcache_server.users.forms import UserCreationForm
from memcache_server.users.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
def test_clean_username(self):
# A user with proto_user params does not exist yet.
proto_user = User... | 27.536585 | 61 | 0.59876 | import pytest
from memcache_server.users.forms import UserCreationForm
from memcache_server.users.tests.factories import UserFactory
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
def test_clean_username(self):
proto_user = UserFactory.build()
form = UserCreationForm(
... | true | true |
1c28d209ca514cadcefb37cb8293dcc804bf5806 | 609 | py | Python | packages/pyright-internal/src/tests/samples/properties2.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 4,391 | 2019-05-07T01:18:57.000Z | 2022-03-31T20:45:44.000Z | packages/pyright-internal/src/tests/samples/properties2.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 2,740 | 2019-05-07T03:29:30.000Z | 2022-03-31T12:57:46.000Z | packages/pyright-internal/src/tests/samples/properties2.py | sasano8/pyright | e804f324ee5dbd25fd37a258791b3fd944addecd | [
"MIT"
] | 455 | 2019-05-07T12:55:14.000Z | 2022-03-31T17:09:15.000Z | # This sample tests handling of the @abc.abstractpropery decorator.
import abc
def requires_int(x: int):
pass
class Foo(abc.ABC):
@abc.abstractproperty
def x(self) -> int:
raise NotImplementedError
@x.setter
def x(self, value: int):
raise NotImplementedError
@abc.abstractp... | 17.4 | 67 | 0.681445 |
import abc
def requires_int(x: int):
pass
class Foo(abc.ABC):
@abc.abstractproperty
def x(self) -> int:
raise NotImplementedError
@x.setter
def x(self, value: int):
raise NotImplementedError
@abc.abstractproperty
def y(self) -> float:
raise NotImplementedError... | true | true |
1c28d25bc269b2d1581f561aa4b40e0f1b672d2e | 1,011 | py | Python | plotting/palette/_LondonUnderground_Colours.py | fhoefling/useful_stuff | 84a3d7afd52162ee5f70bcbd0657f4e2d1add904 | [
"BSD-2-Clause"
] | null | null | null | plotting/palette/_LondonUnderground_Colours.py | fhoefling/useful_stuff | 84a3d7afd52162ee5f70bcbd0657f4e2d1add904 | [
"BSD-2-Clause"
] | null | null | null | plotting/palette/_LondonUnderground_Colours.py | fhoefling/useful_stuff | 84a3d7afd52162ee5f70bcbd0657f4e2d1add904 | [
"BSD-2-Clause"
] | null | null | null | #__all__ = ['build_palette']
color_dict = {
'Bakerloo': '#894e24',
'Central': '#dc241f',
'Circle': '#ffce00',
'District': '#007229',
'Hammersmith': '#d799af',
'Jubilee': '#868f98',
'Metropolitan': '#751056',
'Northern': '#000000',
'Piccadilly': '#... | 22.977273 | 43 | 0.486647 |
color_dict = {
'Bakerloo': '#894e24',
'Central': '#dc241f',
'Circle': '#ffce00',
'District': '#007229',
'Hammersmith': '#d799af',
'Jubilee': '#868f98',
'Metropolitan': '#751056',
'Northern': '#000000',
'Piccadilly': '#0010a8',
'Victoria':... | true | true |
1c28d41ae25574d591eaff73672c1aae8b8cd7d5 | 17,675 | py | Python | solarwindpy/tests/test_quantities.py | blalterman/SolarWindPy | c906f1ea1b833fedc717d906d14d2531e6c03d66 | [
"BSD-3-Clause"
] | null | null | null | solarwindpy/tests/test_quantities.py | blalterman/SolarWindPy | c906f1ea1b833fedc717d906d14d2531e6c03d66 | [
"BSD-3-Clause"
] | 4 | 2020-03-24T16:53:54.000Z | 2022-03-12T00:58:31.000Z | solarwindpy/tests/test_quantities.py | blalterman/SolarWindPy | c906f1ea1b833fedc717d906d14d2531e6c03d66 | [
"BSD-3-Clause"
] | 1 | 2021-11-24T23:10:32.000Z | 2021-11-24T23:10:32.000Z | #!/usr/bin/env python
r"""Test :py:class:`~solarwindpy.core.vector.Vector` and :py:class:`~solarwindpy.core.tensor.Tensor`.
"""
import pdb
# import re as re
import numpy as np
import pandas as pd
import unittest
import sys
import pandas.testing as pdt
from unittest import TestCase
from abc import ABC, abstractpropert... | 33.099251 | 101 | 0.562942 |
import pdb
import numpy as np
import pandas as pd
import unittest
import sys
import pandas.testing as pdt
from unittest import TestCase
from abc import ABC, abstractproperty
from scipy import constants
from solarwindpy.tests import test_base as base
from solarwindpy import vector
from solarwindpy import tensor
... | true | true |
1c28d4c131632b055ebcfa0106ad2486db6adbd4 | 5,578 | py | Python | typic/types/email.py | wyfo/typical | 5fc5326b3509d0b9d35c15dae9590d6cf37a0354 | [
"MIT"
] | 157 | 2019-03-20T19:12:28.000Z | 2022-03-25T08:57:53.000Z | typic/types/email.py | wyfo/typical | 5fc5326b3509d0b9d35c15dae9590d6cf37a0354 | [
"MIT"
] | 147 | 2019-07-03T20:00:52.000Z | 2022-02-10T11:38:39.000Z | typic/types/email.py | wyfo/typical | 5fc5326b3509d0b9d35c15dae9590d6cf37a0354 | [
"MIT"
] | 15 | 2019-03-21T11:01:03.000Z | 2022-01-08T10:38:15.000Z | from __future__ import annotations
import dataclasses
import re
from typing import ClassVar, Pattern, Match, Optional
from urllib.parse import quote
from typic.util import cached_property, slotted
from .url import (
NetworkAddress,
PRIVATE_HOSTS,
INTERNAL_HOSTS,
INTERNAL_IP_PATTERN,
NetworkAddress... | 29.670213 | 102 | 0.59394 | from __future__ import annotations
import dataclasses
import re
from typing import ClassVar, Pattern, Match, Optional
from urllib.parse import quote
from typic.util import cached_property, slotted
from .url import (
NetworkAddress,
PRIVATE_HOSTS,
INTERNAL_HOSTS,
INTERNAL_IP_PATTERN,
NetworkAddress... | true | true |
1c28d61dbc05e81253d94819c75360a0851d7bec | 27 | py | Python | snippets/credit-reverse.py | timgates42/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 12 | 2015-04-12T06:18:33.000Z | 2021-03-03T23:54:19.000Z | snippets/credit-reverse.py | takwas/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 1 | 2021-11-24T20:10:19.000Z | 2021-11-24T20:10:19.000Z | snippets/credit-reverse.py | takwas/balanced-python | 1df86b45c36a97ec2e214480c6806c4df3c79860 | [
"MIT"
] | 14 | 2015-03-23T17:52:06.000Z | 2021-11-24T11:04:15.000Z | reversal = credit.reverse() | 27 | 27 | 0.777778 | reversal = credit.reverse() | true | true |
1c28d6c0c89123bbb2ea2e23f1b00871ecf364c5 | 7,992 | py | Python | batch/batch/cloud/gcp/resources.py | daniel-goldstein/hail | 88d7f312882eaf22d16c9d58c1223e5469c98cab | [
"MIT"
] | null | null | null | batch/batch/cloud/gcp/resources.py | daniel-goldstein/hail | 88d7f312882eaf22d16c9d58c1223e5469c98cab | [
"MIT"
] | 19 | 2022-03-03T20:11:41.000Z | 2022-03-30T20:31:57.000Z | batch/batch/cloud/gcp/resources.py | pwc2/hail | edeb70bc789c881dffa0724ddd11fcb25e689b67 | [
"MIT"
] | null | null | null | import abc
from typing import Dict, Any, Optional
from ...driver.billing_manager import ProductVersions
from ...resources import (Resource, StaticSizedDiskResourceMixin, ComputeResourceMixin, MemoryResourceMixin, IPFeeResourceMixin, ServiceFeeResourceMixin,
DynamicSizedDiskResourceMixin, Quan... | 33.3 | 153 | 0.659284 | import abc
from typing import Dict, Any, Optional
from ...driver.billing_manager import ProductVersions
from ...resources import (Resource, StaticSizedDiskResourceMixin, ComputeResourceMixin, MemoryResourceMixin, IPFeeResourceMixin, ServiceFeeResourceMixin,
DynamicSizedDiskResourceMixin, Quan... | true | true |
1c28d7e7735264731f56049937d3a80168662c6f | 346 | py | Python | cartography/intel/aws/ec2/__init__.py | ryohare/cartography | 3829a97289bc2b28d041e6d7860678e2375dcee1 | [
"Apache-2.0"
] | 2,322 | 2019-03-02T01:07:20.000Z | 2022-03-31T20:39:12.000Z | cartography/intel/aws/ec2/__init__.py | ryohare/cartography | 3829a97289bc2b28d041e6d7860678e2375dcee1 | [
"Apache-2.0"
] | 462 | 2019-03-07T18:38:11.000Z | 2022-03-31T14:55:20.000Z | cartography/intel/aws/ec2/__init__.py | ryohare/cartography | 3829a97289bc2b28d041e6d7860678e2375dcee1 | [
"Apache-2.0"
] | 246 | 2019-03-03T02:39:23.000Z | 2022-02-24T09:46:38.000Z | import logging
from typing import List
import boto3
from cartography.util import timeit
logger = logging.getLogger(__name__)
@timeit
def get_ec2_regions(boto3_session: boto3.session.Session) -> List[str]:
client = boto3_session.client('ec2')
result = client.describe_regions()
return [r['RegionName'] fo... | 21.625 | 71 | 0.751445 | import logging
from typing import List
import boto3
from cartography.util import timeit
logger = logging.getLogger(__name__)
@timeit
def get_ec2_regions(boto3_session: boto3.session.Session) -> List[str]:
client = boto3_session.client('ec2')
result = client.describe_regions()
return [r['RegionName'] fo... | true | true |
1c28d8e6f6653716430cf9eaa373461fe1df32a8 | 8,275 | py | Python | src/python/collision_approx_fourier.py | thibnoel/solo-collisions | 87bf492266578b7bfd04a6657675b1477d27b314 | [
"BSD-2-Clause"
] | null | null | null | src/python/collision_approx_fourier.py | thibnoel/solo-collisions | 87bf492266578b7bfd04a6657675b1477d27b314 | [
"BSD-2-Clause"
] | null | null | null | src/python/collision_approx_fourier.py | thibnoel/solo-collisions | 87bf492266578b7bfd04a6657675b1477d27b314 | [
"BSD-2-Clause"
] | 1 | 2022-03-04T07:49:28.000Z | 2022-03-04T07:49:28.000Z | import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
from solo12_shoulder_collision_utils import followBoundary, colMapToDistField
# Load the collision map from file
res = 200
col_map_file = './npy_data/collision_map_centered_res{}.npy'.format(res)
dist_field_file = './npy_data/updated_collisio... | 34.623431 | 158 | 0.670816 | import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
from solo12_shoulder_collision_utils import followBoundary, colMapToDistField
res = 200
col_map_file = './npy_data/collision_map_centered_res{}.npy'.format(res)
dist_field_file = './npy_data/updated_collision_map_distance_res{}.npy'.format(r... | true | true |
1c28d8f1dd9ab6fea20d27f3a869995936a21e65 | 23,857 | py | Python | granular_access/lambda_functions/granular_access_assets_govenance/granular_access_assets_govenance.py | DataChant/amazon-quicksight-sdk-proserve | 98c8ceb1b603f7c5dd88357c49e8f71372cd3a1a | [
"MIT-0"
] | null | null | null | granular_access/lambda_functions/granular_access_assets_govenance/granular_access_assets_govenance.py | DataChant/amazon-quicksight-sdk-proserve | 98c8ceb1b603f7c5dd88357c49e8f71372cd3a1a | [
"MIT-0"
] | null | null | null | granular_access/lambda_functions/granular_access_assets_govenance/granular_access_assets_govenance.py | DataChant/amazon-quicksight-sdk-proserve | 98c8ceb1b603f7c5dd88357c49e8f71372cd3a1a | [
"MIT-0"
] | null | null | null | import json
import boto3
import logging
import csv
import io
import os
import tempfile
# import awswrangler as wr
from typing import Any, Callable, Dict, List, Optional, Union
import botocore
def default_botocore_config() -> botocore.config.Config:
"""Botocore configuration."""
retries_config: Dict[str, Unio... | 39.828047 | 118 | 0.472482 | import json
import boto3
import logging
import csv
import io
import os
import tempfile
from typing import Any, Callable, Dict, List, Optional, Union
import botocore
def default_botocore_config() -> botocore.config.Config:
retries_config: Dict[str, Union[str, int]] = {
"max_attempts": int(os.getenv("AWS_... | true | true |
1c28da05f18750e69a4499fd9b9574f15d267cee | 1,726 | py | Python | src/primaires/objet/types/clef.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/primaires/objet/types/clef.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | src/primaires/objet/types/clef.py | stormi/tsunami | bdc853229834b52b2ee8ed54a3161a1a3133d926 | [
"BSD-3-Clause"
] | null | null | null | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# l... | 41.095238 | 79 | 0.75956 |
from .base import BaseType
class Clef(BaseType):
nom_type = "clef"
| true | true |
1c28db9a9dfb3b11f3a3ad3cce50ebf20cfc11ad | 6,101 | py | Python | homeassistant/components/sensor/haveibeenpwned.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 4 | 2019-05-14T20:33:43.000Z | 2021-09-25T14:56:08.000Z | homeassistant/components/sensor/haveibeenpwned.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/sensor/haveibeenpwned.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 1 | 2020-08-26T20:54:14.000Z | 2020-08-26T20:54:14.000Z | """
Support for haveibeenpwned (email breaches) sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.haveibeenpwned/
"""
from datetime import timedelta
import logging
import voluptuous as vol
import requests
from homeassistant.components.senso... | 34.083799 | 78 | 0.636945 | from datetime import timedelta
import logging
import voluptuous as vol
import requests
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (STATE_UNKNOWN, CONF_EMAIL)
from homeassistant.helpers.entity import Entity
import homeassistant.helpers.config_validation as cv
from homea... | true | true |
1c28dbe6c3bbd945ec608feb9baac9a60a0f82fc | 1,573 | py | Python | lib/spack/spack/util/string.py | whitfin/spack | aabd2be31a511d0e00c1017f7311a421659319d9 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-06-27T13:26:50.000Z | 2019-07-01T16:24:54.000Z | lib/spack/spack/util/string.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 75 | 2016-07-27T11:43:00.000Z | 2020-12-08T15:56:53.000Z | lib/spack/spack/util/string.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 8 | 2015-10-16T13:51:49.000Z | 2021-10-18T13:58:03.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
def comma_list(sequence, article=''):
if type(sequence) != list:
sequence = list(sequence)
if not sequen... | 27.12069 | 79 | 0.577241 |
def comma_list(sequence, article=''):
if type(sequence) != list:
sequence = list(sequence)
if not sequence:
return
elif len(sequence) == 1:
return sequence[0]
else:
out = ', '.join(str(s) for s in sequence[:-1])
if len(sequence) != 2:
out += ','... | true | true |
1c28dc4368194dea8544f92bce5cbc97249cc52d | 25 | py | Python | nephelae_utils/__init__.py | pnarvor/nephelae_base | d5f1abeae0b0473b895b4735f182ddae0516a1bd | [
"BSD-3-Clause"
] | null | null | null | nephelae_utils/__init__.py | pnarvor/nephelae_base | d5f1abeae0b0473b895b4735f182ddae0516a1bd | [
"BSD-3-Clause"
] | null | null | null | nephelae_utils/__init__.py | pnarvor/nephelae_base | d5f1abeae0b0473b895b4735f182ddae0516a1bd | [
"BSD-3-Clause"
] | null | null | null | from . import analysis
| 6.25 | 22 | 0.72 | from . import analysis
| true | true |
1c28dc53c64a238cfb89fa0d26b51d014039b665 | 4,497 | py | Python | python/ray/util/client/__init__.py | ChaceAshcraft/ray | a72237f1712e2805f6799de3489e326e2965d624 | [
"Apache-2.0"
] | 1 | 2021-01-29T12:24:02.000Z | 2021-01-29T12:24:02.000Z | python/ray/util/client/__init__.py | ChaceAshcraft/ray | a72237f1712e2805f6799de3489e326e2965d624 | [
"Apache-2.0"
] | 8 | 2021-06-05T07:09:35.000Z | 2022-02-19T08:06:20.000Z | python/ray/util/client/__init__.py | ChaceAshcraft/ray | a72237f1712e2805f6799de3489e326e2965d624 | [
"Apache-2.0"
] | 1 | 2021-01-29T12:24:05.000Z | 2021-01-29T12:24:05.000Z | from typing import List, Tuple, Dict, Any
import logging
logger = logging.getLogger(__name__)
class RayAPIStub:
"""This class stands in as the replacement API for the `import ray` module.
Much like the ray module, this mostly delegates the work to the
_client_worker. As parts of the ray API are covered... | 35.690476 | 79 | 0.620414 | from typing import List, Tuple, Dict, Any
import logging
logger = logging.getLogger(__name__)
class RayAPIStub:
def __init__(self):
from ray.util.client.api import ClientAPI
self.api = ClientAPI()
self.client_worker = None
self._server = None
self._connected_with_init = ... | true | true |
1c28e0ef5e0178f2a6b29c2098b158a63af7e914 | 3,076 | py | Python | code/Attack/ParameterTypes/Port.py | TomasMadeja/ID2T | 77f51c074d1ff83c7d648ae62ecaed3e5cfde80c | [
"MIT"
] | 33 | 2018-11-21T12:50:52.000Z | 2022-01-12T05:38:12.000Z | code/Attack/ParameterTypes/Port.py | TomasMadeja/ID2T | 77f51c074d1ff83c7d648ae62ecaed3e5cfde80c | [
"MIT"
] | 108 | 2018-11-21T12:33:47.000Z | 2022-02-09T15:56:59.000Z | code/Attack/ParameterTypes/Port.py | TomasMadeja/ID2T | 77f51c074d1ff83c7d648ae62ecaed3e5cfde80c | [
"MIT"
] | 20 | 2018-11-22T13:03:20.000Z | 2022-01-12T00:19:28.000Z | import re
import typing as t
import Attack.ParameterTypes.BaseType as BaseType
class Port(BaseType.ParameterType):
def __init__(self):
super(Port, self).__init__()
self.name = "Port"
def validate(self, value: int) -> (bool, int):
return Port._is_port(value)
@staticmethod
de... | 38.936709 | 119 | 0.56827 | import re
import typing as t
import Attack.ParameterTypes.BaseType as BaseType
class Port(BaseType.ParameterType):
def __init__(self):
super(Port, self).__init__()
self.name = "Port"
def validate(self, value: int) -> (bool, int):
return Port._is_port(value)
@staticmethod
de... | true | true |
1c28e166f2238f1dbb0444bf95a576c4e46259a4 | 213 | py | Python | main/urls.py | gureuso/turnthepage | f86f4e6e80e4a817b06cc5c777d733cf8171310e | [
"Apache-2.0"
] | 1 | 2019-04-27T13:36:26.000Z | 2019-04-27T13:36:26.000Z | main/urls.py | gureuso/turnthepage | f86f4e6e80e4a817b06cc5c777d733cf8171310e | [
"Apache-2.0"
] | 7 | 2020-06-05T20:21:29.000Z | 2022-03-11T23:44:41.000Z | main/urls.py | gureuso/turnthepage | f86f4e6e80e4a817b06cc5c777d733cf8171310e | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
app_name = 'main'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('favicon.ico', views.FaviconView.as_view(), name='favicon'),
]
| 19.363636 | 69 | 0.676056 | from django.urls import path
from . import views
app_name = 'main'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('favicon.ico', views.FaviconView.as_view(), name='favicon'),
]
| true | true |
1c28e168ae825e8f1dd49be18f9f919a5a26e5c5 | 19,390 | py | Python | sympy/printing/codeprinter.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 2 | 2018-12-05T02:30:43.000Z | 2020-11-14T01:43:15.000Z | sympy/printing/codeprinter.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | null | null | null | sympy/printing/codeprinter.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division
from functools import wraps
from sympy.core import Add, Mul, Pow, S, sympify, Float
from sympy.core.basic import Basic
from sympy.core.containers import Tuple
from sympy.core.compatibility import default_sort_key, string_types
from sympy.core.function import Lambda
from... | 39.171717 | 118 | 0.586127 | from __future__ import print_function, division
from functools import wraps
from sympy.core import Add, Mul, Pow, S, sympify, Float
from sympy.core.basic import Basic
from sympy.core.containers import Tuple
from sympy.core.compatibility import default_sort_key, string_types
from sympy.core.function import Lambda
from... | true | true |
1c28e18ad10c4c28a7dd07b3acfa7409e8c816b1 | 3,576 | py | Python | libs/fuel/fuel/converters/cifar100.py | dendisuhubdy/attention-lvcsr | 598d487c118e66875fdd625baa84ed29d283b800 | [
"MIT"
] | 767 | 2015-05-21T03:32:01.000Z | 2019-02-10T13:34:41.000Z | libs/fuel/fuel/converters/cifar100.py | shenshenzhanzhan/attention-lvcsr | 598d487c118e66875fdd625baa84ed29d283b800 | [
"MIT"
] | 274 | 2015-05-16T19:18:45.000Z | 2018-09-06T07:13:38.000Z | libs/fuel/fuel/converters/cifar100.py | shenshenzhanzhan/attention-lvcsr | 598d487c118e66875fdd625baa84ed29d283b800 | [
"MIT"
] | 258 | 2015-05-21T04:55:25.000Z | 2019-01-23T07:34:27.000Z | import os
import tarfile
import h5py
import numpy
import six
from six.moves import cPickle
from fuel.converters.base import fill_hdf5_file, check_exists
DISTRIBUTION_FILE = 'cifar-100-python.tar.gz'
@check_exists(required_files=[DISTRIBUTION_FILE])
def convert_cifar100(directory, output_directory,
... | 33.111111 | 78 | 0.626957 | import os
import tarfile
import h5py
import numpy
import six
from six.moves import cPickle
from fuel.converters.base import fill_hdf5_file, check_exists
DISTRIBUTION_FILE = 'cifar-100-python.tar.gz'
@check_exists(required_files=[DISTRIBUTION_FILE])
def convert_cifar100(directory, output_directory,
... | true | true |
1c28e1f1c448bb5be57c32450b02224e8768b5d2 | 25,334 | py | Python | pyscf/df/hessian/uhf.py | azag0/pyscf | 1e3e27b61b3cfd22c9679d2c9851c13b3ebc5a1b | [
"Apache-2.0"
] | 2 | 2021-09-17T06:10:17.000Z | 2022-01-22T23:37:22.000Z | pyscf/df/hessian/uhf.py | azag0/pyscf | 1e3e27b61b3cfd22c9679d2c9851c13b3ebc5a1b | [
"Apache-2.0"
] | null | null | null | pyscf/df/hessian/uhf.py | azag0/pyscf | 1e3e27b61b3cfd22c9679d2c9851c13b3ebc5a1b | [
"Apache-2.0"
] | 2 | 2020-06-01T05:31:38.000Z | 2022-02-08T02:38:33.000Z | #!/usr/bin/env python
#
# This code was copied from the data generation program of Tencent Alchemy
# project (https://github.com/tencent-alchemy).
#
#
# #
# # Copyright 2019 Tencent America LLC. All Rights Reserved.
# #
# # Licensed under the Apache License, Version 2.0 (the "License");
# # you may not use this file e... | 44.367776 | 115 | 0.570656 |
ssobj, mo_energy=None, mo_coeff=None, mo_occ=None,
atmlst=None, max_memory=4000, verbose=None, with_k=True):
log = logger.new_logger(hessobj, verbose)
time0 = t1 = (time.clock(), time.time())
mol = hessobj.mol
mf = hessobj.base
if mo_energy is None: mo_energy = mf.mo_ene... | true | true |
1c28e22739393c68178febfae2562a0c2c9016c0 | 155 | py | Python | tests/conftest.py | zaibon/js-ng | 8b63c04757d1432ed4aa588500a113610701de14 | [
"Apache-2.0"
] | 2 | 2021-04-28T10:46:08.000Z | 2021-12-22T12:33:34.000Z | tests/conftest.py | zaibon/js-ng | 8b63c04757d1432ed4aa588500a113610701de14 | [
"Apache-2.0"
] | 321 | 2020-06-15T11:48:21.000Z | 2022-03-29T22:13:33.000Z | tests/conftest.py | zaibon/js-ng | 8b63c04757d1432ed4aa588500a113610701de14 | [
"Apache-2.0"
] | 4 | 2020-06-18T06:19:29.000Z | 2021-07-14T12:54:47.000Z | def pytest_collection_modifyitems(items, config):
for item in items:
if not any(item.iter_markers()):
item.add_marker("unittests")
| 31 | 49 | 0.670968 | def pytest_collection_modifyitems(items, config):
for item in items:
if not any(item.iter_markers()):
item.add_marker("unittests")
| true | true |
1c28e23e2f00d969b63b411d6ff7f2566e463277 | 4,234 | py | Python | securify/solidity/utils.py | AlexandreH/securify2 | 2d2ba0e1c20cdda550120ecdc1a7164db9b90e3c | [
"Apache-2.0"
] | 258 | 2020-01-23T16:58:38.000Z | 2022-03-31T17:29:25.000Z | securify/solidity/utils.py | sirhashalot/securify2 | 6852707449577add14bafce8e304946b3490a977 | [
"Apache-2.0"
] | 34 | 2020-01-30T06:11:58.000Z | 2022-02-27T07:53:17.000Z | securify/solidity/utils.py | sirhashalot/securify2 | 6852707449577add14bafce8e304946b3490a977 | [
"Apache-2.0"
] | 66 | 2020-01-28T09:23:05.000Z | 2022-03-22T09:01:43.000Z | import itertools
from dataclasses import dataclass
from functools import lru_cache
from io import StringIO
from tokenize import generate_tokens
from typing import List, Iterable, TypeVar, Callable, Type, Optional
from securify.grammar.attributes.annotations3 import synthesized
T = TypeVar("T")
@dataclass
class Unde... | 23.392265 | 104 | 0.599906 | import itertools
from dataclasses import dataclass
from functools import lru_cache
from io import StringIO
from tokenize import generate_tokens
from typing import List, Iterable, TypeVar, Callable, Type, Optional
from securify.grammar.attributes.annotations3 import synthesized
T = TypeVar("T")
@dataclass
class Unde... | true | true |
1c28e2753555bd55e815072b4f52e5ba9d63b78d | 1,077 | py | Python | gdc_fastq_splitter/__main__.py | kmhernan/gdc-fastq-splitter | cd1ad03e578638051b173b9ddf7e9861cb9c95ef | [
"Apache-2.0"
] | 2 | 2018-03-27T00:58:35.000Z | 2020-10-13T20:03:08.000Z | gdc_fastq_splitter/__main__.py | kmhernan/gdc-fastq-splitter | cd1ad03e578638051b173b9ddf7e9861cb9c95ef | [
"Apache-2.0"
] | 1 | 2020-07-01T17:32:49.000Z | 2020-07-02T18:38:39.000Z | gdc_fastq_splitter/__main__.py | kmhernan/gdc-fastq-splitter | cd1ad03e578638051b173b9ddf7e9861cb9c95ef | [
"Apache-2.0"
] | 3 | 2019-06-07T18:15:15.000Z | 2021-01-09T13:05:02.000Z | """Main entrypoint for gdc-fastq-splitter CLI"""
import argparse
import time
from signal import signal, SIGPIPE, SIG_DFL
from gdc_fastq_splitter import VERSION
from gdc_fastq_splitter.utils import get_logger
from gdc_fastq_splitter.handler import main_handler
signal(SIGPIPE, SIG_DFL)
def main(args=None):
"""The... | 26.925 | 78 | 0.685237 | import argparse
import time
from signal import signal, SIGPIPE, SIG_DFL
from gdc_fastq_splitter import VERSION
from gdc_fastq_splitter.utils import get_logger
from gdc_fastq_splitter.handler import main_handler
signal(SIGPIPE, SIG_DFL)
def main(args=None):
start = time.time()
logger = get_logger("gdc-fastq-... | true | true |
1c28e2878e99a8e86114f181ff3a99e94a42a261 | 13,115 | py | Python | homeassistant/helpers/event.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 1 | 2021-04-08T06:02:25.000Z | 2021-04-08T06:02:25.000Z | homeassistant/helpers/event.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:32:11.000Z | 2022-01-13T01:19:23.000Z | homeassistant/helpers/event.py | dauden1184/home-assistant | f4c6d389b77d0efa86644e76604eaea5d21abdb5 | [
"Apache-2.0"
] | 1 | 2019-04-16T14:07:20.000Z | 2019-04-16T14:07:20.000Z | """Helpers for listening to events."""
from datetime import timedelta
import functools as ft
from homeassistant.loader import bind_hass
from homeassistant.helpers.sun import get_astral_event_next
from ..core import HomeAssistant, callback
from ..const import (
ATTR_NOW, EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MAT... | 32.302956 | 79 | 0.691041 | from datetime import timedelta
import functools as ft
from homeassistant.loader import bind_hass
from homeassistant.helpers.sun import get_astral_event_next
from ..core import HomeAssistant, callback
from ..const import (
ATTR_NOW, EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_ALL)
from ..util import dt as dt_uti... | true | true |
1c28e2a3e6e2ba27051a5531d417b9a6ee5aa25b | 1,983 | py | Python | tests/generation/modules/decoder_nets/stacked_self_attention_test.py | matt-peters/allennlp-models | cdd505ed539fdc2b82e4cc0a23eae4bfd3368e7e | [
"Apache-2.0"
] | 402 | 2020-03-11T22:58:35.000Z | 2022-03-29T09:05:27.000Z | tests/generation/modules/decoder_nets/stacked_self_attention_test.py | matt-peters/allennlp-models | cdd505ed539fdc2b82e4cc0a23eae4bfd3368e7e | [
"Apache-2.0"
] | 116 | 2020-03-11T01:26:57.000Z | 2022-03-25T13:03:56.000Z | tests/generation/modules/decoder_nets/stacked_self_attention_test.py | matt-peters/allennlp-models | cdd505ed539fdc2b82e4cc0a23eae4bfd3368e7e | [
"Apache-2.0"
] | 140 | 2020-03-11T00:51:35.000Z | 2022-03-29T09:05:36.000Z | import torch
from allennlp.common.testing import AllenNlpTestCase
from allennlp_models.generation import StackedSelfAttentionDecoderNet
class TestStackedSelfAttentionDecoderNet(AllenNlpTestCase):
def test_stacked_self_attention_decoder_net_init(self):
decoder_inout_dim = 10
decoder_net = Stacked... | 38.882353 | 96 | 0.683812 | import torch
from allennlp.common.testing import AllenNlpTestCase
from allennlp_models.generation import StackedSelfAttentionDecoderNet
class TestStackedSelfAttentionDecoderNet(AllenNlpTestCase):
def test_stacked_self_attention_decoder_net_init(self):
decoder_inout_dim = 10
decoder_net = Stacked... | true | true |
1c28e2acd60fcbdac94b1687c546f3d8d4b375b2 | 200 | py | Python | core/urls.py | PqES/forkuptool | ae7caf33642245618ff59cdc6ff7eb94ea125034 | [
"MIT"
] | null | null | null | core/urls.py | PqES/forkuptool | ae7caf33642245618ff59cdc6ff7eb94ea125034 | [
"MIT"
] | null | null | null | core/urls.py | PqES/forkuptool | ae7caf33642245618ff59cdc6ff7eb94ea125034 | [
"MIT"
] | 1 | 2021-03-17T17:25:37.000Z | 2021-03-17T17:25:37.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^index/', views.index, name='index'),
url(r'^index/', views.index, name='home'),
url(r'^$', views.index, name='index'),
] | 25 | 44 | 0.655 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^index/', views.index, name='index'),
url(r'^index/', views.index, name='home'),
url(r'^$', views.index, name='index'),
] | true | true |
1c28e5041ed5aa0c648caa11b1f30e5c3638ac9e | 5,665 | py | Python | assignments/assignment1/knn.py | GusevMihail/dlcourse_ai | 7f20c625e09f92f20f2da9304abb1a4edd4ae93c | [
"MIT"
] | null | null | null | assignments/assignment1/knn.py | GusevMihail/dlcourse_ai | 7f20c625e09f92f20f2da9304abb1a4edd4ae93c | [
"MIT"
] | null | null | null | assignments/assignment1/knn.py | GusevMihail/dlcourse_ai | 7f20c625e09f92f20f2da9304abb1a4edd4ae93c | [
"MIT"
] | null | null | null | import numpy as np
class KNN:
"""
K-neariest-neighbor classifier using L1 loss
"""
def __init__(self, k=1):
self.k = k
def fit(self, X, y):
self.train_X = X
self.train_y = y
def predict(self, X, num_loops=0):
'''
Uses the KNN model to predict clases f... | 35.186335 | 96 | 0.593469 | import numpy as np
class KNN:
def __init__(self, k=1):
self.k = k
def fit(self, X, y):
self.train_X = X
self.train_y = y
def predict(self, X, num_loops=0):
if num_loops == 0:
dists = self.compute_distances_no_loops(X)
elif num_loops == 1:
... | true | true |
1c28e555dbd199717795ab9432e956d14bd13e61 | 3,643 | py | Python | datasets/mnist.py | rohitgirdhar/ActionVLAD | 0d87b69d3069db3fe521923675e353f755c5d765 | [
"Apache-2.0"
] | 228 | 2017-05-08T04:50:49.000Z | 2021-12-23T10:57:52.000Z | datasets/mnist.py | icyzhang0923/ActionVLAD | 08d3d65301940991e0a0cdca2c0534edf6749f41 | [
"Apache-2.0"
] | 39 | 2017-05-12T05:23:46.000Z | 2021-03-21T03:40:02.000Z | datasets/mnist.py | icyzhang0923/ActionVLAD | 08d3d65301940991e0a0cdca2c0534edf6749f41 | [
"Apache-2.0"
] | 84 | 2017-05-08T01:11:25.000Z | 2021-06-03T09:37:36.000Z | # ------------------------------------------------------------------------------
# ActionVLAD: Learning spatio-temporal aggregation for action classification
# Copyright (c) 2017 Carnegie Mellon University and Adobe Systems Incorporated
# Please see LICENSE on https://github.com/rohitgirdhar/ActionVLAD/ for details
# -... | 35.028846 | 80 | 0.693385 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
from datasets import dataset_utils
slim = tf.contrib.slim
_FILE_PATTERN = 'mnist_%s.tfrecord'
_SPLITS_TO_SIZES = {'train': 60000, 'test': 10000}
_NUM_C... | true | true |
1c28e83259edda8b65fa317e5d0384c00899b62a | 3,933 | py | Python | test/MiscLib/tests/TestScanFiles.py | mkozuharov/DataStage | a61e67c901c2b43afa0fec6a99ef72152391a55f | [
"MIT"
] | 8 | 2015-02-25T10:58:52.000Z | 2020-04-17T03:11:48.000Z | test/MiscLib/tests/TestScanFiles.py | mkozuharov/DataStage | a61e67c901c2b43afa0fec6a99ef72152391a55f | [
"MIT"
] | null | null | null | test/MiscLib/tests/TestScanFiles.py | mkozuharov/DataStage | a61e67c901c2b43afa0fec6a99ef72152391a55f | [
"MIT"
] | 7 | 2015-02-25T10:58:54.000Z | 2019-11-04T16:19:22.000Z | # ---------------------------------------------------------------------
#
# Copyright (c) 2012 University of Oxford
#
# 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, incl... | 39.727273 | 111 | 0.668955 |
import sys
import unittest
import re
from os.path import normpath
sys.path.append("../..")
from MiscLib.ScanFiles import *
from MiscLib.Functions import compareLists
class TestScanFiles(unittest.TestCase):
def setUp(self):
self.testpath = "resources/"
self.testpatt =... | true | true |
1c28e8867cb298b05a45e4ad4e3868b665847d04 | 2,650 | py | Python | opendbc/can/tests/test_packer_parser.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 85 | 2019-06-14T17:51:31.000Z | 2022-02-09T22:18:20.000Z | opendbc/can/tests/test_packer_parser.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 4 | 2018-12-08T19:02:06.000Z | 2019-09-01T13:54:26.000Z | opendbc/can/tests/test_packer_parser.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | 73 | 2018-12-03T19:34:42.000Z | 2020-07-27T05:10:23.000Z | #!/usr/bin/env python3
import unittest
from opendbc.can.parser import CANParser
from opendbc.can.packer import CANPacker
import cereal.messaging as messaging
# Python implementation so we don't have to depend on boardd
def can_list_to_can_capnp(can_msgs, msgtype='can'):
dat = messaging.new_message()
dat.init(ms... | 25 | 93 | 0.626038 |
import unittest
from opendbc.can.parser import CANParser
from opendbc.can.packer import CANPacker
import cereal.messaging as messaging
def can_list_to_can_capnp(can_msgs, msgtype='can'):
dat = messaging.new_message()
dat.init(msgtype, len(can_msgs))
for i, can_msg in enumerate(can_msgs):
if msgtype == ... | true | true |
1c28e88fd554392b7578028583827bb82f1fcb30 | 1,386 | py | Python | tests/providers/google/cloud/operators/test_workflows_system.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | tests/providers/google/cloud/operators/test_workflows_system.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | tests/providers/google/cloud/operators/test_workflows_system.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 38.5 | 103 | 0.779942 |
import pytest
from tests.providers.google.cloud.utils.gcp_authenticator import GCP_WORKFLOWS_KEY
from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, GoogleSystemTest, provide_gcp_context
@pytest.mark.system("google.cloud")
@pytest.mark.credential_file(GCP_WORKFLOWS_KEY)
class CloudVisi... | true | true |
1c28e8bcb12175bf9c70588b23a2f0811f1f9a91 | 17,078 | py | Python | retopoflow/rftool_polystrips/polystrips_ops.py | Unnoen/retopoflow | 73c7cfc10a0b58937198d60e308ba5248b446490 | [
"OML"
] | 1 | 2022-01-10T23:40:21.000Z | 2022-01-10T23:40:21.000Z | retopoflow/rftool_polystrips/polystrips_ops.py | Unnoen/retopoflow | 73c7cfc10a0b58937198d60e308ba5248b446490 | [
"OML"
] | null | null | null | retopoflow/rftool_polystrips/polystrips_ops.py | Unnoen/retopoflow | 73c7cfc10a0b58937198d60e308ba5248b446490 | [
"OML"
] | null | null | null | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson, and Patrick Moore
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation... | 41.755501 | 128 | 0.549479 |
import math
from mathutils import Vector
from mathutils.geometry import intersect_point_tri_2d, intersect_point_tri_2d
from ..rftool import RFTool
from ...addon_common.common.bezier import CubicBezierSpline, CubicBezier
from ...addon_common.common.debug import dprint
from ...addon_common.common.drawing import Drawin... | true | true |
1c28e920f88618a9674d2ff13cef322ba9f307f8 | 9,949 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20190701/get_inbound_nat_rule.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/network/v20190701/get_inbound_nat_rule.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/network/v20190701/get_inbound_nat_rule.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 43.445415 | 289 | 0.682883 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'GetInboundNatRuleResult',
'AwaitableGetInboundNatRuleResult',
'get_inbound_nat_rule',
]
@pulumi.output_type
class GetInb... | true | true |
1c28eabf8a78b41e6a9d6a9092a0d6c638ec0182 | 8,684 | py | Python | tests/test_check_config.py | tousix/faucet | 63ec37f9007075afd154589464e99e463382f97b | [
"Apache-2.0"
] | null | null | null | tests/test_check_config.py | tousix/faucet | 63ec37f9007075afd154589464e99e463382f97b | [
"Apache-2.0"
] | null | null | null | tests/test_check_config.py | tousix/faucet | 63ec37f9007075afd154589464e99e463382f97b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Innovation Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except i... | 25.391813 | 97 | 0.583372 |
import logging
import os
import shutil
import tempfile
import unittest
import re
from faucet import check_faucet_config
class CheckConfigTestCase(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
def tearDown(self):
shutil.rmtree(self.tmpdir)
def r... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.