hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70aa1d2ea6632a54b826457990b43dc4fd8bddf | 753 | py | Python | app.py | MattJAshworth/UniSecrets | 9a6bd50cf32cf5231e68c7cd465ad19aa06a95df | [
"MIT"
] | null | null | null | app.py | MattJAshworth/UniSecrets | 9a6bd50cf32cf5231e68c7cd465ad19aa06a95df | [
"MIT"
] | null | null | null | app.py | MattJAshworth/UniSecrets | 9a6bd50cf32cf5231e68c7cd465ad19aa06a95df | [
"MIT"
] | null | null | null | import os
from flask import Flask, flash, render_template, request
from helpers import *
app = Flask(__name__)
app.secret_key = 'dkjkffksks'
@app.route('/', methods=["GET", "POST"])
def index():
"""Index page"""
if request.method == "POST":
msg = request.form.get("textarea")
img = request.form.get("output_imag... | 22.147059 | 56 | 0.671979 | import os
from flask import Flask, flash, render_template, request
from helpers import *
app = Flask(__name__)
app.secret_key = 'dkjkffksks'
@app.route('/', methods=["GET", "POST"])
def index():
if request.method == "POST":
msg = request.form.get("textarea")
img = request.form.get("output_image")
if msg:
f... | true | true |
f70aa1f851e87de45e05a82e45e38f5a66e1e297 | 1,417 | py | Python | flaskgallery/models/photos_azuretable.py | davidrpk/FlaskGallery | f9d83e5fa4047b06bc30e0df2dd5372b3843ae52 | [
"MIT"
] | 1 | 2018-12-27T09:56:21.000Z | 2018-12-27T09:56:21.000Z | flaskgallery/models/photos_azuretable.py | davidrpk/FlaskGallery | f9d83e5fa4047b06bc30e0df2dd5372b3843ae52 | [
"MIT"
] | null | null | null | flaskgallery/models/photos_azuretable.py | davidrpk/FlaskGallery | f9d83e5fa4047b06bc30e0df2dd5372b3843ae52 | [
"MIT"
] | null | null | null | from azure.cosmosdb.table.tableservice import TableService
from azure.cosmosdb.table.models import Entity
import uuid
class PhotoCollectionAzureTable:
_connectionstring = ''
def __init__(self, connectionstring):
self._connectionstring = connectionstring
def fetchall(self):
table_service ... | 38.297297 | 78 | 0.642202 | from azure.cosmosdb.table.tableservice import TableService
from azure.cosmosdb.table.models import Entity
import uuid
class PhotoCollectionAzureTable:
_connectionstring = ''
def __init__(self, connectionstring):
self._connectionstring = connectionstring
def fetchall(self):
table_service ... | true | true |
f70aa22a002782b4022717ef4422ec8b2e7b9632 | 2,670 | py | Python | ml_source/src/blocktorch/blocktorch/tests/data_checks_tests/test_data_check_action.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | 1 | 2021-09-23T12:23:02.000Z | 2021-09-23T12:23:02.000Z | ml_source/src/blocktorch/blocktorch/tests/data_checks_tests/test_data_check_action.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | null | null | null | ml_source/src/blocktorch/blocktorch/tests/data_checks_tests/test_data_check_action.py | blocktorch/blocktorch | 044aa269813ab22c5fd27f84272e5fb540fc522b | [
"MIT"
] | null | null | null | from blocktorch.data_checks import DataCheckAction, DataCheckActionCode
def test_data_check_action_attributes():
data_check_action = DataCheckAction(DataCheckActionCode.DROP_COL)
assert data_check_action.action_code == DataCheckActionCode.DROP_COL
assert data_check_action.metadata == {}
data_check_ac... | 37.605634 | 85 | 0.749438 | from blocktorch.data_checks import DataCheckAction, DataCheckActionCode
def test_data_check_action_attributes():
data_check_action = DataCheckAction(DataCheckActionCode.DROP_COL)
assert data_check_action.action_code == DataCheckActionCode.DROP_COL
assert data_check_action.metadata == {}
data_check_ac... | true | true |
f70aa42301809fd9f98ccec8576480d2fba80fc4 | 1,656 | py | Python | tests/test_api_sync.py | irux/pdfgen-python | fe7f6beb9dda8e1ddd23356ee44dd89c8367bc02 | [
"MIT"
] | null | null | null | tests/test_api_sync.py | irux/pdfgen-python | fe7f6beb9dda8e1ddd23356ee44dd89c8367bc02 | [
"MIT"
] | null | null | null | tests/test_api_sync.py | irux/pdfgen-python | fe7f6beb9dda8e1ddd23356ee44dd89c8367bc02 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import codecs
import io
import os
import sys
import unittest
import pytest
import pdfgen
from pdfgen.errors import InvalidSourceError
TEST_PATH = os.path.dirname(os.path.realpath(__file__))
EXAMPLE_HTML_FILE = f'{TEST_PATH}/fixtures/example.html'
class TestPdfGenerationSyncApi(unittest.TestC... | 30.666667 | 106 | 0.675725 |
import codecs
import io
import os
import sys
import unittest
import pytest
import pdfgen
from pdfgen.errors import InvalidSourceError
TEST_PATH = os.path.dirname(os.path.realpath(__file__))
EXAMPLE_HTML_FILE = f'{TEST_PATH}/fixtures/example.html'
class TestPdfGenerationSyncApi(unittest.TestCase):
def setUp(se... | true | true |
f70aa4a2de2bf42538645b9735d80df41cc00a94 | 6,317 | py | Python | SimG4CMS/HcalTestBeam/test/python/run2006_33_cfg.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 2 | 2020-01-27T15:21:37.000Z | 2020-05-11T11:13:18.000Z | SimG4CMS/HcalTestBeam/test/python/run2006_33_cfg.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 8 | 2020-03-20T23:18:36.000Z | 2020-05-27T11:00:06.000Z | SimG4CMS/HcalTestBeam/test/python/run2006_33_cfg.py | gputtley/cmssw | c1ef8454804e4ebea8b65f59c4a952a6c94fde3b | [
"Apache-2.0"
] | 3 | 2017-06-07T15:22:28.000Z | 2019-02-28T20:48:30.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("PROD")
process.load('SimG4CMS.HcalTestBeam.TB2006Geometry33XML_cfi')
process.load('SimGeneral.HepPDTESSource.pdt_cfi')
process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load("Geom... | 43.868056 | 119 | 0.610891 | import FWCore.ParameterSet.Config as cms
process = cms.Process("PROD")
process.load('SimG4CMS.HcalTestBeam.TB2006Geometry33XML_cfi')
process.load('SimGeneral.HepPDTESSource.pdt_cfi')
process.load('Configuration.StandardSequences.Services_cff')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load("Geom... | true | true |
f70aa50090b5c9275e05b9d12c46f122f2b59ef0 | 20,793 | py | Python | website/canvas/migrations/0200_auto__del_field_comment_reply_text.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 19 | 2015-11-10T17:36:20.000Z | 2021-04-12T07:36:00.000Z | website/canvas/migrations/0200_auto__del_field_comment_reply_text.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 1 | 2021-06-09T03:45:34.000Z | 2021-06-09T03:45:34.000Z | website/canvas/migrations/0200_auto__del_field_comment_reply_text.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 6 | 2015-11-11T00:38:38.000Z | 2020-07-25T20:10:08.000Z | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Comment.reply_text'
db.delete_column(u'canvas_comment', 'reply_text')
def backwards(... | 80.281853 | 198 | 0.559611 |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.delete_column(u'canvas_comment', 'reply_text')
def backwards(self, orm):
db.add_column(u'canvas_comment'... | true | true |
f70aa5dbf19b752d396afe92c981d393af43e061 | 496 | py | Python | povary/apps/gallery/urls.py | TorinAsakura/cooking | cf0c78f613fa9ce0fcd4ec7a397ab880d9dd631a | [
"BSD-3-Clause"
] | null | null | null | povary/apps/gallery/urls.py | TorinAsakura/cooking | cf0c78f613fa9ce0fcd4ec7a397ab880d9dd631a | [
"BSD-3-Clause"
] | null | null | null | povary/apps/gallery/urls.py | TorinAsakura/cooking | cf0c78f613fa9ce0fcd4ec7a397ab880d9dd631a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'povary.views.home', name='home'),
# url(r'^povary/', include('povary.foo.urls')),
url(r'^recipe_gallery/(?P<recipe_slug>.*)/$',
'gallery.views.recipe_gallery_upload',
name='recipe_... | 29.176471 | 89 | 0.643145 |
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^recipe_gallery/(?P<recipe_slug>.*)/$',
'gallery.views.recipe_gallery_upload',
name='recipe_gallery_upload'
),
)
| true | true |
f70aa5dfbb682865ae09f99631d5f9e4a343d737 | 3,128 | py | Python | isi_sdk_9_0_0/isi_sdk_9_0_0/models/hdfs_fsimage_job.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/hdfs_fsimage_job.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/hdfs_fsimage_job.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_9_0_0.models.hdfs_f... | 26.735043 | 90 | 0.563299 |
import pprint
import re
import six
from isi_sdk_9_0_0.models.hdfs_fsimage_job_job import HdfsFsimageJobJob
class HdfsFsimageJob(object):
swagger_types = {
'job': 'HdfsFsimageJobJob'
}
attribute_map = {
'job': 'job'
}
def __init__(self, job=None):
self._job =... | true | true |
f70aa6ade73961c39dcb9421c207c2719fa61e4d | 4,492 | py | Python | src/you_get/extractors/universal.py | whohow123/you-get | 00f3dfa71f53abd495424c527b5ef3debc6fb6d2 | [
"MIT"
] | 1 | 2021-01-18T06:10:46.000Z | 2021-01-18T06:10:46.000Z | src/you_get/extractors/universal.py | whohow123/you-get | 00f3dfa71f53abd495424c527b5ef3debc6fb6d2 | [
"MIT"
] | null | null | null | src/you_get/extractors/universal.py | whohow123/you-get | 00f3dfa71f53abd495424c527b5ef3debc6fb6d2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
__all__ = ['universal_download']
from ..common import *
from .embed import *
def universal_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
try:
content_type = get_head(url, headers=fake_headers)['Content-Type']
except:
content_type = get_head(url, h... | 37.123967 | 98 | 0.477293 |
__all__ = ['universal_download']
from ..common import *
from .embed import *
def universal_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
try:
content_type = get_head(url, headers=fake_headers)['Content-Type']
except:
content_type = get_head(url, headers=fake_headers, ... | true | true |
f70aa74839e42512f38a961e1c90480641251648 | 618 | py | Python | dataset/corpus_to_txts.py | fubiye/edgar-abs-kg | 3973059c7b1cdaab8a4e857a43c702ac0be7e725 | [
"MIT"
] | null | null | null | dataset/corpus_to_txts.py | fubiye/edgar-abs-kg | 3973059c7b1cdaab8a4e857a43c702ac0be7e725 | [
"MIT"
] | null | null | null | dataset/corpus_to_txts.py | fubiye/edgar-abs-kg | 3973059c7b1cdaab8a4e857a43c702ac0be7e725 | [
"MIT"
] | null | null | null | # coding=utf-8
import pandas as pd
from pathlib import Path
# extract corpus to seprate files
OUT_PUT_DIR = r'D:\data\edgar\example\documents'
df = pd.read_csv(r'D:\data\edgar\example\corpus.csv')
# def write_to_file(cik,filingId,fileName,content):
def write_to_file(cik,filingId,fileName,content):
base_dir = Path(... | 38.625 | 102 | 0.718447 |
import pandas as pd
from pathlib import Path
OUT_PUT_DIR = r'D:\data\edgar\example\documents'
df = pd.read_csv(r'D:\data\edgar\example\corpus.csv')
def write_to_file(cik,filingId,fileName,content):
base_dir = Path(OUT_PUT_DIR)
file_name = str(cik) + '+' + str(filingId) + '+' + str(fileName)
file_name = ... | true | true |
f70aa7996c2228497dd2bb330beb6f83430d396c | 1,084 | py | Python | var/spack/repos/builtin/packages/r-adsplit/package.py | nkianggiss/spack | 3477d3375142a30f5714bb5966a6d8bb22c33c06 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-06-27T13:26:50.000Z | 2019-07-01T16:24:54.000Z | var/spack/repos/builtin/packages/r-adsplit/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 75 | 2016-07-27T11:43:00.000Z | 2020-12-08T15:56:53.000Z | var/spack/repos/builtin/packages/r-adsplit/package.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)
from spack import *
class RAdsplit(RPackage):
"""This package implements clustering of microarray gene expression
... | 40.148148 | 73 | 0.697417 |
from spack import *
class RAdsplit(RPackage):
homepage = "https://www.bioconductor.org/packages/adSplit/"
git = "https://git.bioconductor.org/packages/adSplit.git"
version('1.46.0', commit='7e81a83f34d371447f491b3a146bf6851e260c7c')
depends_on('r@3.4.0:3.4.9', when='@1.46.0')
depends_... | true | true |
f70aa8f33cdb5f92221c46798f909eb1746b2cac | 3,187 | py | Python | paintball-pointofsale/group.py | alecspringel/paintball-pointofsale | a1f776e36881afa2815db8babdb1c0aa04a3a33b | [
"MIT"
] | 1 | 2020-10-28T01:49:16.000Z | 2020-10-28T01:49:16.000Z | paintball-pointofsale/group.py | alecspringel/paintball-pointofsale | a1f776e36881afa2815db8babdb1c0aa04a3a33b | [
"MIT"
] | null | null | null | paintball-pointofsale/group.py | alecspringel/paintball-pointofsale | a1f776e36881afa2815db8babdb1c0aa04a3a33b | [
"MIT"
] | null | null | null | class Group:
"""
name: Name of group (String)
deposit: $ Amount required to book the group (Float)
type: Speedball, Recball, Rental (String)
players: ([Object])
paint_bags: list of paint the group has purchased ([Int])
transactions: ([Object])
"""
def __init__(self, name, ... | 24.328244 | 62 | 0.566991 | class Group:
def __init__(self, name, deposit, type):
self.name = name
self.deposit = deposit
self.type = type
self.players = []
self.paint_bags = []
self.transactions = []
def get_name(self):
return self.name
def get_type(self):
... | true | true |
f70aa9af67a7af7f95fc82fb4874f9b5bfbd4072 | 21,125 | py | Python | ezclimate/optimization.py | Yili-Yang/Litterman_Carbon_Pricing | 71eeefc5e2d9b4c1473a9a6ae85c33b019e32d84 | [
"MIT"
] | null | null | null | ezclimate/optimization.py | Yili-Yang/Litterman_Carbon_Pricing | 71eeefc5e2d9b4c1473a9a6ae85c33b019e32d84 | [
"MIT"
] | null | null | null | ezclimate/optimization.py | Yili-Yang/Litterman_Carbon_Pricing | 71eeefc5e2d9b4c1473a9a6ae85c33b019e32d84 | [
"MIT"
] | null | null | null | from __future__ import division, print_function
import numpy as np
import multiprocessing
from tools import _pickle_method, _unpickle_method
try:
import copy_reg
except:
import copyreg as copy_reg
import types
copy_reg.pickle(types.MethodType, _pickle_method, _unpickle_method)
class GeneticAlgorithm(object):
... | 30.660377 | 144 | 0.696 | from __future__ import division, print_function
import numpy as np
import multiprocessing
from tools import _pickle_method, _unpickle_method
try:
import copy_reg
except:
import copyreg as copy_reg
import types
copy_reg.pickle(types.MethodType, _pickle_method, _unpickle_method)
class GeneticAlgorithm(object):
... | true | true |
f70aa9c8456546362c9a960d81b4e7ddc3d4290f | 56,584 | py | Python | tests/test_disparity.py | steuxyo/Pandora | 57db04f31d6cecba93fa3bc0091f624c8b8ec5f1 | [
"Apache-2.0"
] | 1 | 2021-03-05T17:35:43.000Z | 2021-03-05T17:35:43.000Z | tests/test_disparity.py | steuxyo/Pandora | 57db04f31d6cecba93fa3bc0091f624c8b8ec5f1 | [
"Apache-2.0"
] | null | null | null | tests/test_disparity.py | steuxyo/Pandora | 57db04f31d6cecba93fa3bc0091f624c8b8ec5f1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf8
#
# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).
#
# This file is part of PANDORA
#
# https://github.com/CNES/Pandora
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | 56.358566 | 134 | 0.598579 |
#
# This file is part of PANDORA
#
# https://github.com/CNES/Pandora
#
# 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 requ... | true | true |
f70aaa0071d96e3d126bd914751dd5bae717ae54 | 3,238 | py | Python | first_lambda/service.py | mylar-pr/DaaS | e41fa9e9fbda66d7150f00e6db13dd3a76cd3501 | [
"MIT"
] | null | null | null | first_lambda/service.py | mylar-pr/DaaS | e41fa9e9fbda66d7150f00e6db13dd3a76cd3501 | [
"MIT"
] | null | null | null | first_lambda/service.py | mylar-pr/DaaS | e41fa9e9fbda66d7150f00e6db13dd3a76cd3501 | [
"MIT"
] | null | null | null | import datetime
import json
import os
import boto3
import pandas as pd
import io
import requests
import numpy as np
from io import StringIO
import uuid
s3 = boto3.resource(
service_name='s3',
region_name='us-east-2')
bucket_name = 'secom-daas-bucket' # already created on S3
link1 = 'https://archive.ics.uci.... | 26.540984 | 117 | 0.665843 | import datetime
import json
import os
import boto3
import pandas as pd
import io
import requests
import numpy as np
from io import StringIO
import uuid
s3 = boto3.resource(
service_name='s3',
region_name='us-east-2')
bucket_name = 'secom-daas-bucket'
link1 = 'https://archive.ics.uci.edu/ml/machine-learning... | true | true |
f70aaad9e57fa7eb04163e7602797b675c9f999e | 1,763 | py | Python | import_dataset/check-triggers.py | MarliesG/Alice | 661a010a2ecf56aec48dcb407d07ae1b0df6915a | [
"MIT"
] | 3 | 2021-08-14T16:18:12.000Z | 2022-01-11T01:27:34.000Z | import_dataset/check-triggers.py | MarliesG/Alice | 661a010a2ecf56aec48dcb407d07ae1b0df6915a | [
"MIT"
] | 1 | 2021-12-15T09:18:42.000Z | 2021-12-29T21:00:58.000Z | import_dataset/check-triggers.py | MarliesG/Alice | 661a010a2ecf56aec48dcb407d07ae1b0df6915a | [
"MIT"
] | 2 | 2021-08-12T13:32:28.000Z | 2021-12-10T10:01:47.000Z | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # Check alignments
# Ch... | 30.396552 | 314 | 0.626773 |
import *
from alice import alice
gt = {f'{i}': alice.load_predictor(f'{i}~gammatone-1', 0.002, 1000, name='WAV') for i in range(1, 13)}
for y in gt.values():
y /= y.std()
for subject in alice:
events = alice.load_events(raw='raw', data_raw=True)
raw = events.info['raw']
raw.load_da... | true | true |
f70aad19b18d8123fb6c2b4551fa9c099adc5484 | 10,940 | py | Python | pytorch_lightning/callbacks/lr_monitor.py | calebrob6/pytorch-lightning | 4c79b3a5b343866217784c66d122819c59a92c1d | [
"Apache-2.0"
] | 1 | 2021-07-22T14:06:43.000Z | 2021-07-22T14:06:43.000Z | pytorch_lightning/callbacks/lr_monitor.py | calebrob6/pytorch-lightning | 4c79b3a5b343866217784c66d122819c59a92c1d | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/callbacks/lr_monitor.py | calebrob6/pytorch-lightning | 4c79b3a5b343866217784c66d122819c59a92c1d | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning 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 law or agreed to i... | 40.973783 | 118 | 0.625686 |
from collections import defaultdict
from typing import Any, DefaultDict, Dict, List, Optional, Set, Type
from torch.optim.optimizer import Optimizer
from pytorch_lightning.callbacks.base import Callback
from pytorch_lightning.utilities import rank_zero_warn
from pytorch_lightning.utilities.exceptions imp... | true | true |
f70aaedf8077bde4e0dc6f024456789860057f34 | 16,381 | py | Python | vsurfree/lib/python2.7/site-packages/fire/fire_test.py | hexnor/SurfFree----Web-Proxy----Django | ab3d0f6d3a3eb06bd532ac2b4f8c0950608b90ba | [
"MIT"
] | 1 | 2021-02-08T07:49:35.000Z | 2021-02-08T07:49:35.000Z | vsurfree/lib/python2.7/site-packages/fire/fire_test.py | yokeshrana/SurfFree | ab3d0f6d3a3eb06bd532ac2b4f8c0950608b90ba | [
"MIT"
] | 2 | 2021-06-01T22:03:20.000Z | 2022-01-13T00:43:38.000Z | vsurfree/lib/python2.7/site-packages/fire/fire_test.py | yokeshrana/SurfFree | ab3d0f6d3a3eb06bd532ac2b4f8c0950608b90ba | [
"MIT"
] | 1 | 2020-11-04T08:39:52.000Z | 2020-11-04T08:39:52.000Z | # Copyright (C) 2017 Google 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 agreed to in writing, ... | 44.034946 | 80 | 0.663635 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import fire
from fire import test_components as tc
from fire import trace
import unittest
class FireTest(unittest.TestCase):
def testFire(self):
fire.Fire(tc.Empty)
fire.Fire(tc.OldS... | true | true |
f70aaf1faf473c2707952e2460f03972a42dbb44 | 69 | py | Python | app/config/secure.py | ZeroLoo/FlaskAPI | 3dd89e83bd99b2de1796a9dfb52dad7b659e6ad2 | [
"MIT"
] | null | null | null | app/config/secure.py | ZeroLoo/FlaskAPI | 3dd89e83bd99b2de1796a9dfb52dad7b659e6ad2 | [
"MIT"
] | null | null | null | app/config/secure.py | ZeroLoo/FlaskAPI | 3dd89e83bd99b2de1796a9dfb52dad7b659e6ad2 | [
"MIT"
] | null | null | null | # -*-coding:utf-8-*-
from flask import Flask
__author__ = 'ZeroLoo'
| 13.8 | 23 | 0.681159 |
from flask import Flask
__author__ = 'ZeroLoo'
| true | true |
f70ab0237408983ce5e23acbdb327225ffb587d6 | 4,041 | py | Python | others/pytrends.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 4 | 2016-12-17T20:06:10.000Z | 2021-11-19T04:45:29.000Z | others/pytrends.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 11 | 2021-01-06T05:35:11.000Z | 2022-03-11T23:28:31.000Z | others/pytrends.py | thorwhalen/ut | 353a4629c35a2cca76ef91a4d5209afe766433b4 | [
"MIT"
] | 3 | 2015-06-12T10:44:16.000Z | 2021-07-26T18:39:47.000Z |
import http.client
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import re
import csv
from http.cookiejar import CookieJar
class pyGTrends(object):
"""
Google Trends API
Recommended usage:
from csv import DictReader
r = pyGTrends(us... | 38.122642 | 146 | 0.560257 |
import http.client
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import re
import csv
from http.cookiejar import CookieJar
class pyGTrends(object):
def __init__(self, username, password):
self.login_params = {
"continue": 'http://www.goog... | true | true |
f70ab04d45cd2b3288ee4efa477201d0066849a2 | 1,293 | py | Python | app/api/utils/readInstanceDetails.py | nurely/lxdui | 8cb31dc1117719b140f440f8a705282781db7b35 | [
"Apache-2.0"
] | null | null | null | app/api/utils/readInstanceDetails.py | nurely/lxdui | 8cb31dc1117719b140f440f8a705282781db7b35 | [
"Apache-2.0"
] | null | null | null | app/api/utils/readInstanceDetails.py | nurely/lxdui | 8cb31dc1117719b140f440f8a705282781db7b35 | [
"Apache-2.0"
] | null | null | null | import platform, sys, os, subprocess
import psutil
from app.api.models.LXDModule import LXDModule
import logging
def readInstanceDetails():
instanceDetails = ("Python Version: {}".format(platform.python_version()))
instanceDetails +=("\nPython Path: {}".format(' '.join(path for path in sys.path)))
instanc... | 33.153846 | 97 | 0.641145 | import platform, sys, os, subprocess
import psutil
from app.api.models.LXDModule import LXDModule
import logging
def readInstanceDetails():
instanceDetails = ("Python Version: {}".format(platform.python_version()))
instanceDetails +=("\nPython Path: {}".format(' '.join(path for path in sys.path)))
instanc... | true | true |
f70ab0747198d4d8109e8dca9b2fd2a0a75a1492 | 241 | py | Python | python_work/salvar_nun_predileto.py | lucas-jsvd/python_crash_course_2nd | 8404e7769bef7b90b9b0897996c3a3f969bb72bd | [
"Unlicense"
] | null | null | null | python_work/salvar_nun_predileto.py | lucas-jsvd/python_crash_course_2nd | 8404e7769bef7b90b9b0897996c3a3f969bb72bd | [
"Unlicense"
] | null | null | null | python_work/salvar_nun_predileto.py | lucas-jsvd/python_crash_course_2nd | 8404e7769bef7b90b9b0897996c3a3f969bb72bd | [
"Unlicense"
] | null | null | null | import json
filename = "num_predileto.txt"
try:
numero = int(input("Qual o seu numero predileto? "))
except ValueError:
print("Você digitou um valor incorreto.")
else:
with open(filename, "w") as f:
json.dump(numero, f)
| 21.909091 | 56 | 0.66805 | import json
filename = "num_predileto.txt"
try:
numero = int(input("Qual o seu numero predileto? "))
except ValueError:
print("Você digitou um valor incorreto.")
else:
with open(filename, "w") as f:
json.dump(numero, f)
| true | true |
f70ab27bcb01927f35c8740cbd127b50bca48faf | 4,338 | py | Python | fastai2/data/block.py | bearpelican/fastai2 | 445fa28e42b8d6205adc135527c22883fcfbef41 | [
"Apache-2.0"
] | null | null | null | fastai2/data/block.py | bearpelican/fastai2 | 445fa28e42b8d6205adc135527c22883fcfbef41 | [
"Apache-2.0"
] | null | null | null | fastai2/data/block.py | bearpelican/fastai2 | 445fa28e42b8d6205adc135527c22883fcfbef41 | [
"Apache-2.0"
] | 1 | 2020-08-20T14:20:47.000Z | 2020-08-20T14:20:47.000Z | #AUTOGENERATED! DO NOT EDIT! File to edit: dev/07_data.block.ipynb (unless otherwise specified).
__all__ = ['TransformBlock', 'CategoryBlock', 'MultiCategoryBlock', 'DataBlock']
#Cell
from ..torch_basics import *
from ..test import *
from .core import *
from .load import *
from .external import *
from .transforms imp... | 48.2 | 121 | 0.693407 |
__all__ = ['TransformBlock', 'CategoryBlock', 'MultiCategoryBlock', 'DataBlock']
from ..torch_basics import *
from ..test import *
from .core import *
from .load import *
from .external import *
from .transforms import *
class TransformBlock():
def __init__(self, type_tfms=None, item_tfms=None, batch_tfms=Cud... | true | true |
f70ab2806f62f35dba6a9c4d850e2fbfb76dd7b6 | 840 | py | Python | setup.py | qri-io/qri-python | ed7b9a0047b3d50623cef40211e9aebf45c05e42 | [
"MIT"
] | 6 | 2019-09-25T20:35:04.000Z | 2021-02-12T16:33:25.000Z | setup.py | qri-io/qri-python | ed7b9a0047b3d50623cef40211e9aebf45c05e42 | [
"MIT"
] | 27 | 2018-08-29T13:50:02.000Z | 2020-10-28T16:52:54.000Z | setup.py | qri-io/qri-python | ed7b9a0047b3d50623cef40211e9aebf45c05e42 | [
"MIT"
] | 3 | 2020-07-21T20:18:09.000Z | 2021-01-16T09:31:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import setuptools
with open('README.md', 'r') as fp:
long_description = fp.read()
pos = long_description.find('# Development')
if pos > -1:
long_description = long_description[:pos]
setuptools.setup(
name='qri',
version='0.1.5',
author='Du... | 25.454545 | 50 | 0.620238 |
import setuptools
with open('README.md', 'r') as fp:
long_description = fp.read()
pos = long_description.find('# Development')
if pos > -1:
long_description = long_description[:pos]
setuptools.setup(
name='qri',
version='0.1.5',
author='Dustin Long',
author_email='dustmop@qri.io... | true | true |
f70ab361101331e9cbcc4a524b6be7427a7c3df4 | 40 | py | Python | projeto0/test_testando.py | Matheus-Zauza-Maschietto/Python-Django | 8f42489ebadbef53863ad00ab474bb213a6cc4bc | [
"MIT"
] | null | null | null | projeto0/test_testando.py | Matheus-Zauza-Maschietto/Python-Django | 8f42489ebadbef53863ad00ab474bb213a6cc4bc | [
"MIT"
] | null | null | null | projeto0/test_testando.py | Matheus-Zauza-Maschietto/Python-Django | 8f42489ebadbef53863ad00ab474bb213a6cc4bc | [
"MIT"
] | null | null | null | def test_something():
assert 1 == 1
| 13.333333 | 21 | 0.625 | def test_something():
assert 1 == 1
| true | true |
f70ab5c7458892a86950720ad6a41431776a170d | 355 | py | Python | tests/views.py | iLoveTux/django-slick-reporting | ef88f3bab3094e976bd306a112501d547c88fed1 | [
"BSD-3-Clause"
] | null | null | null | tests/views.py | iLoveTux/django-slick-reporting | ef88f3bab3094e976bd306a112501d547c88fed1 | [
"BSD-3-Clause"
] | null | null | null | tests/views.py | iLoveTux/django-slick-reporting | ef88f3bab3094e976bd306a112501d547c88fed1 | [
"BSD-3-Clause"
] | null | null | null | from slick_reporting.views import SampleReportView
from .models import OrderLine
class MonthlyProductSales(SampleReportView):
report_model = OrderLine
date_field = 'date_placed' # or 'order__date_placed'
group_by = 'product'
columns = ['name', 'sku']
time_series_pattern = 'monthly'
time_serie... | 29.583333 | 57 | 0.746479 | from slick_reporting.views import SampleReportView
from .models import OrderLine
class MonthlyProductSales(SampleReportView):
report_model = OrderLine
date_field = 'date_placed'
group_by = 'product'
columns = ['name', 'sku']
time_series_pattern = 'monthly'
time_series_columns = ['__total_qua... | true | true |
f70ab5e049ad23ad9364f4d20975e6dd5a3fcac6 | 7,595 | py | Python | utilities/generate_schema.py | hep-gc/cloud-scheduler-2 | 180d9dc4f8751cf8c8254518e46f83f118187e84 | [
"Apache-2.0"
] | 3 | 2020-03-03T03:25:36.000Z | 2021-12-03T15:31:39.000Z | utilities/generate_schema.py | hep-gc/cloud-scheduler-2 | 180d9dc4f8751cf8c8254518e46f83f118187e84 | [
"Apache-2.0"
] | 341 | 2017-06-08T17:27:59.000Z | 2022-01-28T19:37:57.000Z | utilities/generate_schema.py | hep-gc/cloud-scheduler-2 | 180d9dc4f8751cf8c8254518e46f83f118187e84 | [
"Apache-2.0"
] | 3 | 2018-04-25T16:13:20.000Z | 2020-04-15T20:03:46.000Z | #!/usr/bin/env python3
"""
Synopsis: utilities/generate_schema.py > lib/schema.py
This routine pulls the current table definitions from the csv2 database and writes the
schema to stdout. To use the schema definitions:
from lib.schema import <view_or_table_name_1>, <view_or_table_name_2>, ...
"""
from sub... | 35.325581 | 127 | 0.474523 |
from subprocess import Popen, PIPE
from tempfile import mkdtemp
import json
import os
import sys
import yaml
REMOVE_BRACKETS = str.maketrans('()', ' ')
def main(args):
gvar = {}
fd = open('/etc/cloudscheduler/cloudscheduler.yaml')
gvar['csv2_config'] = yaml.full_load(fd.read())
fd.close()
... | true | true |
f70ab5e26ff2ae94d430049a05b5c236c13075a0 | 8,872 | py | Python | train.py | antonyvigouret/Text-Recognition-PyTorch | 7576480684612e856602169b3229fe6c8f4b4b9d | [
"MIT"
] | 2 | 2020-11-12T17:28:30.000Z | 2020-11-13T14:45:52.000Z | train.py | antonyvigouret/Text-Recognition-PyTorch | 7576480684612e856602169b3229fe6c8f4b4b9d | [
"MIT"
] | null | null | null | train.py | antonyvigouret/Text-Recognition-PyTorch | 7576480684612e856602169b3229fe6c8f4b4b9d | [
"MIT"
] | null | null | null | import string
import torch
from torch.nn import CrossEntropyLoss
from torch.nn import CTCLoss
import torch.optim as optim
from torch.utils.tensorboard import SummaryWriter
from torchsummary import summary
from tqdm import tqdm
from cnn_seq2seq import ConvSeq2Seq
from cnn_seq2seq import Decoder
from cnn_seq2seq import... | 33.479245 | 102 | 0.577435 | import string
import torch
from torch.nn import CrossEntropyLoss
from torch.nn import CTCLoss
import torch.optim as optim
from torch.utils.tensorboard import SummaryWriter
from torchsummary import summary
from tqdm import tqdm
from cnn_seq2seq import ConvSeq2Seq
from cnn_seq2seq import Decoder
from cnn_seq2seq import... | true | true |
f70ab5f20cd07c566f212fef5ff14cea04806a5f | 4,204 | py | Python | tests/services/test_file_svc.py | emmanvg/caldera | 633a3f1ab06543d737791186f9a22c6587e5fa44 | [
"Apache-2.0"
] | 1 | 2021-05-24T08:44:09.000Z | 2021-05-24T08:44:09.000Z | tests/services/test_file_svc.py | watchmen-coder/caldera | f13521b69ce959dad31911d4afa4e20a21790875 | [
"Apache-2.0"
] | 1 | 2021-04-16T00:03:00.000Z | 2021-04-16T00:03:00.000Z | tests/services/test_file_svc.py | watchmen-coder/caldera | f13521b69ce959dad31911d4afa4e20a21790875 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
import yaml
from tests import AsyncMock
from asyncio import Future
from app.utility.file_decryptor import decrypt
@pytest.mark.usefixtures(
'init_base_world'
)
class TestFileService:
def test_save_file(self, loop, file_svc, tmp_path):
filename = "test_file.txt"
paylo... | 41.623762 | 138 | 0.697193 | import os
import pytest
import yaml
from tests import AsyncMock
from asyncio import Future
from app.utility.file_decryptor import decrypt
@pytest.mark.usefixtures(
'init_base_world'
)
class TestFileService:
def test_save_file(self, loop, file_svc, tmp_path):
filename = "test_file.txt"
paylo... | true | true |
f70ab6303c20b904700391f719907f8e8cc2decf | 1,225 | py | Python | cifrari-kali/cbc_decode.py | mfranzil/unitn-reti-avanzate | 802438239b3b5ff2bdce6e50a60da1c945892def | [
"MIT"
] | null | null | null | cifrari-kali/cbc_decode.py | mfranzil/unitn-reti-avanzate | 802438239b3b5ff2bdce6e50a60da1c945892def | [
"MIT"
] | null | null | null | cifrari-kali/cbc_decode.py | mfranzil/unitn-reti-avanzate | 802438239b3b5ff2bdce6e50a60da1c945892def | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# cbc_decode.py
#
# Programma minimale per l'applicazione di un cifrario
# a blocchi su un messaggio, in modalità CBC (Chained Block Cypher)
# in cui ogni blocco viene messo in OR esclusivo con il codice
# del blocco precedente prima di essere cifrato.
#
# Nel nostro cas... | 18.560606 | 71 | 0.634286 |
# a blocchi su un messaggio, in modalità CBC (Chained Block Cypher)
# in cui ogni blocco viene messo in OR esclusivo con il codice
# del blocco precedente prima di essere cifrato.
#
# Nel nostro caso, un blocco corrisponde a un byte, e l'algoritmo
#
# Istruzioni:
#
# - creare il file codice.bin come descritto in... | true | true |
f70ab708cedc7d676fb9539fa566730b57172e01 | 3,437 | py | Python | uvicorn/_handlers/http.py | pacoyang/uvicorn | 27f76476a14dac68a62dc2998717997607a36197 | [
"BSD-3-Clause"
] | 1 | 2021-07-05T21:49:51.000Z | 2021-07-05T21:49:51.000Z | uvicorn/_handlers/http.py | pacoyang/uvicorn | 27f76476a14dac68a62dc2998717997607a36197 | [
"BSD-3-Clause"
] | null | null | null | uvicorn/_handlers/http.py | pacoyang/uvicorn | 27f76476a14dac68a62dc2998717997607a36197 | [
"BSD-3-Clause"
] | 1 | 2022-02-03T09:38:16.000Z | 2022-02-03T09:38:16.000Z | import asyncio
from typing import TYPE_CHECKING
from uvicorn.config import Config
if TYPE_CHECKING: # pragma: no cover
from uvicorn.server import ServerState
async def handle_http(
reader: asyncio.StreamReader,
writer: asyncio.StreamWriter,
server_state: "ServerState",
config: Config,
) -> None... | 38.617978 | 89 | 0.686936 | import asyncio
from typing import TYPE_CHECKING
from uvicorn.config import Config
if TYPE_CHECKING:
from uvicorn.server import ServerState
async def handle_http(
reader: asyncio.StreamReader,
writer: asyncio.StreamWriter,
server_state: "ServerState",
config: Config,
) -> None:
... | true | true |
f70ab8d503bc1a07f2845052f215ca548687a1c6 | 985 | py | Python | axelrod/tests/unit/test_appeaser.py | lipingzhu/Zero-determinant | 6e30aa72358d5dfc3975abe433d0d13cc3a750a1 | [
"MIT"
] | null | null | null | axelrod/tests/unit/test_appeaser.py | lipingzhu/Zero-determinant | 6e30aa72358d5dfc3975abe433d0d13cc3a750a1 | [
"MIT"
] | null | null | null | axelrod/tests/unit/test_appeaser.py | lipingzhu/Zero-determinant | 6e30aa72358d5dfc3975abe433d0d13cc3a750a1 | [
"MIT"
] | null | null | null | """Test for the appeaser strategy."""
import axelrod
from .test_player import TestPlayer
C, D = axelrod.Actions.C, axelrod.Actions.D
class TestAppeaser(TestPlayer):
name = "Appeaser"
player = axelrod.Appeaser
expected_classifier = {
'memory_depth': float('inf'), # Depends on internal memory.
... | 26.621622 | 69 | 0.587817 |
import axelrod
from .test_player import TestPlayer
C, D = axelrod.Actions.C, axelrod.Actions.D
class TestAppeaser(TestPlayer):
name = "Appeaser"
player = axelrod.Appeaser
expected_classifier = {
'memory_depth': float('inf'),
'stochastic': False,
'makes_use_of': set(),
... | true | true |
f70ab935221e9aefaf57a36d017a5208e50b8892 | 2,327 | py | Python | _Figure_S18.py | aspuru-guzik-group/routescore | 3adedbc1d6193751bd1cd0af33395572b35a8e43 | [
"MIT"
] | 1 | 2021-11-05T00:49:40.000Z | 2021-11-05T00:49:40.000Z | _Figure_S18.py | aspuru-guzik-group/routescore | 3adedbc1d6193751bd1cd0af33395572b35a8e43 | [
"MIT"
] | null | null | null | _Figure_S18.py | aspuru-guzik-group/routescore | 3adedbc1d6193751bd1cd0af33395572b35a8e43 | [
"MIT"
] | 1 | 2021-08-18T02:54:49.000Z | 2021-08-18T02:54:49.000Z | #!/usr/bin/env python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Custom style
plt.style.use('scientific')
# absolute tolerances for chimera
absolutes = np.array([0.67, 1080000, 0.2, 0.15848931924611134])
# load in gryffin runs with Naive score as objective
df_nai... | 39.440678 | 120 | 0.706919 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use('scientific')
absolutes = np.array([0.67, 1080000, 0.2, 0.15848931924611134])
df_naive = pd.read_pickle('Optimization/runs/gryffin_runs_naive.pkl')
fig, axes = plt.subplots(nrows=4, ncols=1, sharex=Tru... | true | true |
f70ab9f4ce715b85813408d26899167161dfba41 | 205 | py | Python | save_df.py | ersilia-os/bioassay-db | 095ceb93e31577085c23105929ccf271b0dcd8f3 | [
"MIT"
] | null | null | null | save_df.py | ersilia-os/bioassay-db | 095ceb93e31577085c23105929ccf271b0dcd8f3 | [
"MIT"
] | null | null | null | save_df.py | ersilia-os/bioassay-db | 095ceb93e31577085c23105929ccf271b0dcd8f3 | [
"MIT"
] | null | null | null | from src.json2df import PubChemBioAssayJsonConverter
c = PubChemBioAssayJsonConverter("./examples", "PUBCHEM400.json")
df = c.get_all_results()
c.save_df(df, "./examples")
c.get_description("./examples")
| 29.285714 | 65 | 0.77561 | from src.json2df import PubChemBioAssayJsonConverter
c = PubChemBioAssayJsonConverter("./examples", "PUBCHEM400.json")
df = c.get_all_results()
c.save_df(df, "./examples")
c.get_description("./examples")
| true | true |
f70aba518e557932c07883c2cc83635918beed14 | 5,378 | py | Python | sctransfer/network.py | jingshuw/sctransfer | 380c3f26934c26cd177e63aacf4f3bdcf9a29c47 | [
"MIT"
] | 4 | 2019-10-22T21:21:14.000Z | 2022-01-05T01:10:37.000Z | sctransfer/network.py | jingshuw/sctransfer | 380c3f26934c26cd177e63aacf4f3bdcf9a29c47 | [
"MIT"
] | 2 | 2020-03-08T03:27:24.000Z | 2020-03-23T21:43:27.000Z | sctransfer/network.py | jingshuw/sctransfer | 380c3f26934c26cd177e63aacf4f3bdcf9a29c47 | [
"MIT"
] | null | null | null | ## code simplified from the dca package
import os
import numpy as np
import scanpy.api as sc
import keras
from keras.layers import Input, Dense, Dropout, Activation, BatchNormalization
from keras.models import Model
from keras.objectives import mean_squared_error
from keras import backend as K
import tensorflow as t... | 34.254777 | 93 | 0.626255 | scanpy.api as sc
import keras
from keras.layers import Input, Dense, Dropout, Activation, BatchNormalization
from keras.models import Model
from keras.objectives import mean_squared_error
from keras import backend as K
import tensorflow as tf
from .loss import NB
from .layers import ConstantDispersionLayer, ColWiseM... | true | true |
f70aba529a4df60d1cdd1a8cfd66159d60f34dc8 | 4,649 | py | Python | seamm_dashboard/routes/admin/forms.py | paulsaxe/seamm_dashboard | 66049c8c58fd34af3bd143157d0138e8fb737f9b | [
"BSD-3-Clause"
] | 5 | 2020-04-17T16:34:13.000Z | 2021-12-09T17:24:01.000Z | seamm_dashboard/routes/admin/forms.py | paulsaxe/seamm_dashboard | 66049c8c58fd34af3bd143157d0138e8fb737f9b | [
"BSD-3-Clause"
] | 55 | 2020-02-26T20:47:52.000Z | 2022-03-12T14:22:10.000Z | seamm_dashboard/routes/admin/forms.py | paulsaxe/seamm_dashboard | 66049c8c58fd34af3bd143157d0138e8fb737f9b | [
"BSD-3-Clause"
] | 4 | 2019-10-15T18:34:14.000Z | 2022-01-04T20:50:43.000Z | from flask_wtf import FlaskForm
from wtforms import (
StringField,
PasswordField,
SubmitField,
SelectMultipleField,
BooleanField,
)
try:
from wtforms.fields import EmailField
except ImportError:
from wtforms.fields.html5 import EmailField
from wtforms.validators import DataRequired, Length,... | 24.860963 | 88 | 0.649817 | from flask_wtf import FlaskForm
from wtforms import (
StringField,
PasswordField,
SubmitField,
SelectMultipleField,
BooleanField,
)
try:
from wtforms.fields import EmailField
except ImportError:
from wtforms.fields.html5 import EmailField
from wtforms.validators import DataRequired, Length,... | true | true |
f70abbfb7844e4c8dd5a47e9d91ebc2a9a7fe405 | 3,910 | py | Python | aiohue/lights.py | spasche/aiohue | 65798ed56f6f123a24a961ac87f604d79a221540 | [
"Apache-2.0"
] | 27 | 2020-04-15T18:08:49.000Z | 2022-03-30T10:12:05.000Z | aiohue/lights.py | spasche/aiohue | 65798ed56f6f123a24a961ac87f604d79a221540 | [
"Apache-2.0"
] | 38 | 2020-06-29T20:32:47.000Z | 2022-03-24T16:23:17.000Z | aiohue/lights.py | spasche/aiohue | 65798ed56f6f123a24a961ac87f604d79a221540 | [
"Apache-2.0"
] | 10 | 2020-05-26T07:34:09.000Z | 2022-03-29T10:59:39.000Z | from collections import namedtuple
from .api import APIItems
# Represents a CIE 1931 XY coordinate pair.
XYPoint = namedtuple("XYPoint", ["x", "y"])
# Represents the Gamut of a light.
GamutType = namedtuple("GamutType", ["red", "green", "blue"])
class Lights(APIItems):
"""Represents Hue Lights.
https://d... | 25.38961 | 80 | 0.541944 | from collections import namedtuple
from .api import APIItems
XYPoint = namedtuple("XYPoint", ["x", "y"])
GamutType = namedtuple("GamutType", ["red", "green", "blue"])
class Lights(APIItems):
def __init__(self, logger, raw, v2_resources, request):
super().__init__(logger, raw, v2_resources, request,... | true | true |
f70abd05078edcca034b41322d960ead8ee31528 | 44 | py | Python | python-tkinter-card-game/python-tkinter-card-game/main (i.e. start here).py | lull-the-unknown/python-tkinter-card-game | bc7a1e62e8d6e29017af505dcab4dda2bd73be52 | [
"Unlicense"
] | 2 | 2019-10-13T23:36:06.000Z | 2020-04-08T12:40:30.000Z | python-tkinter-card-game/python-tkinter-card-game/main (i.e. start here).py | lull-the-unknown/python-tkinter-card-game | bc7a1e62e8d6e29017af505dcab4dda2bd73be52 | [
"Unlicense"
] | null | null | null | python-tkinter-card-game/python-tkinter-card-game/main (i.e. start here).py | lull-the-unknown/python-tkinter-card-game | bc7a1e62e8d6e29017af505dcab4dda2bd73be52 | [
"Unlicense"
] | 2 | 2020-04-10T13:05:53.000Z | 2020-07-01T08:15:41.000Z | import app
gameApp = app.app()
gameApp.Run() | 14.666667 | 19 | 0.727273 | import app
gameApp = app.app()
gameApp.Run() | true | true |
f70abd71a15afc4c6c020151c56ad1c6df1a0f50 | 14,347 | py | Python | lux/vis/Vis.py | thyneb19/lux | 07a282d6a5f60c05942d866fa6f33636c3428abc | [
"Apache-2.0"
] | null | null | null | lux/vis/Vis.py | thyneb19/lux | 07a282d6a5f60c05942d866fa6f33636c3428abc | [
"Apache-2.0"
] | null | null | null | lux/vis/Vis.py | thyneb19/lux | 07a282d6a5f60c05942d866fa6f33636c3428abc | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 The Lux Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 37.45953 | 199 | 0.572454 |
from typing import List, Callable, Union
from lux.vis.Clause import Clause
from lux.utils.utils import check_import_lux_widget
import lux
import warnings
class Vis:
def __init__(self, intent, source=None, title="", score=0.0):
self._intent = intent
self._inferred_intent = intent ... | true | true |
f70abe164281395130c469a9d83bf0c6bc202f8f | 1,855 | py | Python | stubs/m5stack_flowui-v1_4_0-beta/flowlib/m5mqtt.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/m5stack_flowui-v1_4_0-beta/flowlib/m5mqtt.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/m5stack_flowui-v1_4_0-beta/flowlib/m5mqtt.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | """
Module: 'flowlib.m5mqtt' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1 - updated
from typing import Any
class M5mqtt:
""""""
def _daemonTask(self, *argv) -> Any:
... | 16.415929 | 141 | 0.547709 |
from typing import Any
class M5mqtt:
def _daemonTask(self, *argv) -> Any:
pass
def _msg_deal(self, *argv) -> Any:
pass
def _on_data(self, *argv) -> Any:
pass
def on_connect(self, *argv) -> Any:
pass
def publish(self, *argv) -> Any:
pass
def start... | true | true |
f70abea11c4ac66c4b8b1ef3a65628f1877a4566 | 3,940 | py | Python | guilded/ext/commands/context.py | DakshG07/KOOLIOMAN | 84d851f9d88e99e884dc6cc38a5638af0c29da9c | [
"MIT"
] | null | null | null | guilded/ext/commands/context.py | DakshG07/KOOLIOMAN | 84d851f9d88e99e884dc6cc38a5638af0c29da9c | [
"MIT"
] | null | null | null | guilded/ext/commands/context.py | DakshG07/KOOLIOMAN | 84d851f9d88e99e884dc6cc38a5638af0c29da9c | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020-present shay (shayypy)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | 36.82243 | 78 | 0.712944 |
import guilded.abc
class Context(guilded.abc.Messageable):
def __init__(self, **attrs):
self.message = attrs.pop('message', None)
self._state = attrs.pop('state', self.message._state)
self.bot = attrs.pop('bot', None)
self.args = attrs.pop('args', [])
self.kwargs = attrs.p... | true | true |
f70ac048c7ab163d01374fa17be97ba5e98dd62a | 5,492 | py | Python | ioos_qc/results.py | glos/ioos_qc | 17e69ad582275be7ad0f5a2af40c11d810b344e8 | [
"Apache-2.0"
] | 31 | 2019-10-09T15:08:38.000Z | 2022-01-21T23:45:22.000Z | ioos_qc/results.py | glos/ioos_qc | 17e69ad582275be7ad0f5a2af40c11d810b344e8 | [
"Apache-2.0"
] | 49 | 2019-10-09T18:58:29.000Z | 2022-02-08T22:52:34.000Z | ioos_qc/results.py | glos/ioos_qc | 17e69ad582275be7ad0f5a2af40c11d810b344e8 | [
"Apache-2.0"
] | 13 | 2019-10-08T19:47:34.000Z | 2022-03-19T18:42:25.000Z | #!/usr/bin/env python
# coding=utf-8
import logging
from typing import NamedTuple, List
from dataclasses import dataclass
from collections import OrderedDict as odict, defaultdict
import numpy as np
from ioos_qc.qartod import QartodFlags
L = logging.getLogger(__name__) # noqa
class CallResult(NamedTuple):
pack... | 33.284848 | 102 | 0.629825 |
import logging
from typing import NamedTuple, List
from dataclasses import dataclass
from collections import OrderedDict as odict, defaultdict
import numpy as np
from ioos_qc.qartod import QartodFlags
L = logging.getLogger(__name__)
class CallResult(NamedTuple):
package: str
test: str
function: call... | true | true |
f70ac14f2dee5acf23ce8ff4dca5cf048c116003 | 7,350 | py | Python | getProductInfo.py | dongil618/Cafe24toSmartstore | 909e2cdf2927d5ecacb7a6484c84f18de67cb47e | [
"MIT"
] | null | null | null | getProductInfo.py | dongil618/Cafe24toSmartstore | 909e2cdf2927d5ecacb7a6484c84f18de67cb47e | [
"MIT"
] | null | null | null | getProductInfo.py | dongil618/Cafe24toSmartstore | 909e2cdf2927d5ecacb7a6484c84f18de67cb47e | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup as bs
import requests
from urllib.request import urlopen
from urllib.parse import quote
import re
import time
def getProductInfo(productNameIndex):
headers = {"User-Agent": "Mozilla/5.0"}
color = []
size = []
price = ""
instruction = ""
sizeGuide = ""
category... | 37.692308 | 90 | 0.460408 | from bs4 import BeautifulSoup as bs
import requests
from urllib.request import urlopen
from urllib.parse import quote
import re
import time
def getProductInfo(productNameIndex):
headers = {"User-Agent": "Mozilla/5.0"}
color = []
size = []
price = ""
instruction = ""
sizeGuide = ""
category... | true | true |
f70ac22e6b088bf21a6bc6c89c1e2ab6834b5bfe | 5,592 | py | Python | alchemist_py/project_manager.py | Kenta11/alchemist_py | 49d013dde4688f663eb2d35519347047739ecace | [
"MIT"
] | null | null | null | alchemist_py/project_manager.py | Kenta11/alchemist_py | 49d013dde4688f663eb2d35519347047739ecace | [
"MIT"
] | 1 | 2021-08-04T14:14:09.000Z | 2021-08-04T14:14:09.000Z | alchemist_py/project_manager.py | Kenta11/alchemist_py | 49d013dde4688f663eb2d35519347047739ecace | [
"MIT"
] | 1 | 2021-07-15T07:05:42.000Z | 2021-07-15T07:05:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import git
import os
import re
import sys
import toml
from pathlib import Path
from alchemist_py.brokergen import createProject
from alchemist_py.deviceinfo import searchDevice
from alchemist_py.plugin_manager import PluginManager
class Manager(object):
def __init_... | 34.732919 | 240 | 0.505722 |
import git
import os
import re
import sys
import toml
from pathlib import Path
from alchemist_py.brokergen import createProject
from alchemist_py.deviceinfo import searchDevice
from alchemist_py.plugin_manager import PluginManager
class Manager(object):
def __init__(self):
config = toml.load(open("Alc... | true | true |
f70ac248b9ef28a76627a9460455648ecfe49916 | 1,177 | py | Python | src/services/incomesService.py | TTIP-UNQ-Team6/gastapp_back | 0613aba610f765b55cb3bb10fec4d0d5f3685f88 | [
"MIT"
] | null | null | null | src/services/incomesService.py | TTIP-UNQ-Team6/gastapp_back | 0613aba610f765b55cb3bb10fec4d0d5f3685f88 | [
"MIT"
] | null | null | null | src/services/incomesService.py | TTIP-UNQ-Team6/gastapp_back | 0613aba610f765b55cb3bb10fec4d0d5f3685f88 | [
"MIT"
] | null | null | null | import pymongo
from bson import ObjectId
from src.services import config
collection = config.db.incomes
def search_by_user_email(user_email, itype):
return collection.find({"user_email": user_email, "itype": itype})
def sum_amounts_by_user(user_email, itype):
pipeline = [{"$match": {"user_email": user_ema... | 24.020408 | 130 | 0.634664 | import pymongo
from bson import ObjectId
from src.services import config
collection = config.db.incomes
def search_by_user_email(user_email, itype):
return collection.find({"user_email": user_email, "itype": itype})
def sum_amounts_by_user(user_email, itype):
pipeline = [{"$match": {"user_email": user_ema... | true | true |
f70ac2d9c5ad8d01fcd7341073e93a56903015f3 | 737 | py | Python | Operations/SC_DFA.py | ClarkLabUVA/hctsa-py | 4382a7e852d21cdfefdac1a4a09ea6e11abd9be1 | [
"MIT"
] | 6 | 2020-08-14T00:16:19.000Z | 2022-01-20T05:49:12.000Z | Operations/SC_DFA.py | fairscape/hctsa-py | 4382a7e852d21cdfefdac1a4a09ea6e11abd9be1 | [
"MIT"
] | null | null | null | Operations/SC_DFA.py | fairscape/hctsa-py | 4382a7e852d21cdfefdac1a4a09ea6e11abd9be1 | [
"MIT"
] | 4 | 2020-08-14T00:22:45.000Z | 2021-02-18T05:31:14.000Z | def SC_DFA(y):
N = len(y)
tau = int(np.floor(N/2))
y = y - np.mean(y)
x = np.cumsum(y)
taus = np.arange(5,tau+1)
ntau = len(taus)
F = np.zeros(ntau)
for i in range(ntau):
t = int(taus[i])
x_buff = x[:N - N % t]
x_buff = x_buff.reshape((int(N / t),t))
... | 14.45098 | 69 | 0.464043 | def SC_DFA(y):
N = len(y)
tau = int(np.floor(N/2))
y = y - np.mean(y)
x = np.cumsum(y)
taus = np.arange(5,tau+1)
ntau = len(taus)
F = np.zeros(ntau)
for i in range(ntau):
t = int(taus[i])
x_buff = x[:N - N % t]
x_buff = x_buff.reshape((int(N / t),t))
... | true | true |
f70ac35da3aea0122566e6991b7d2d9cdf82c5b6 | 473 | py | Python | chemreg/utils/management/commands/lint.py | Chemical-Curation/chemcurator | bcd7fab84e407f06502e6873c38820724d4e54e7 | [
"MIT"
] | 1 | 2020-10-05T18:02:24.000Z | 2020-10-05T18:02:24.000Z | chemreg/utils/management/commands/lint.py | Chemical-Curation/chemcurator_django | bcd7fab84e407f06502e6873c38820724d4e54e7 | [
"MIT"
] | 207 | 2020-01-30T19:17:44.000Z | 2021-02-24T19:45:29.000Z | chemreg/utils/management/commands/lint.py | Chemical-Curation/chemcurator_django | bcd7fab84e407f06502e6873c38820724d4e54e7 | [
"MIT"
] | null | null | null | import subprocess
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Automatically fixes formatting issues and reports any other linting errors"
def handle(self, *args, **options):
subprocess.run(["isort", "--apply", "--quiet"], c... | 33.785714 | 87 | 0.701903 | import subprocess
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Automatically fixes formatting issues and reports any other linting errors"
def handle(self, *args, **options):
subprocess.run(["isort", "--apply", "--quiet"], c... | true | true |
f70ac41ed03f636596fe6dd578ad492699f6b41c | 410 | py | Python | template_extends/template_extends/wsgi.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | template_extends/template_extends/wsgi.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | template_extends/template_extends/wsgi.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | """
WSGI config for template_extends project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJ... | 24.117647 | 78 | 0.795122 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "template_extends.settings")
application = get_wsgi_application()
| true | true |
f70ac69af650810765016d290bfa000e9f4b2f74 | 30,759 | py | Python | tests/test_assets.py | semio/zipline | f13e9fd1253a500771bf10217b1d37031272c03c | [
"Apache-2.0"
] | null | null | null | tests/test_assets.py | semio/zipline | f13e9fd1253a500771bf10217b1d37031272c03c | [
"Apache-2.0"
] | null | null | null | tests/test_assets.py | semio/zipline | f13e9fd1253a500771bf10217b1d37031272c03c | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2015 Quantopian, 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 agreed to in wr... | 35.933411 | 79 | 0.559934 |
import sys
from unittest import TestCase
from datetime import datetime, timedelta
import pickle
import uuid
import warnings
import pandas as pd
from pandas.tseries.tools import normalize_date
from pandas.util.testing import assert_frame_equal
from nose_parameterized import parameterized
from numpy im... | true | true |
f70ac6e62fb9f9e5e0c7c2c31fe3b1b5c0bbd9d6 | 539 | py | Python | manage.py | Yaawei/allfeed | 1739c975e541eead4c14b7b4fc28ccf755c356f3 | [
"MIT"
] | null | null | null | manage.py | Yaawei/allfeed | 1739c975e541eead4c14b7b4fc28ccf755c356f3 | [
"MIT"
] | null | null | null | manage.py | Yaawei/allfeed | 1739c975e541eead4c14b7b4fc28ccf755c356f3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "allfeed.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are ... | 33.6875 | 73 | 0.686456 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "allfeed.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's install... | true | true |
f70ac71ee9ad98039917cae3b7458fec58f7ca1d | 760 | py | Python | mvpsite/users/constants.py | mianamir/advance_django_rest_framework_project | 3870f2dbe7b585a236928f90c1792cd337ce8911 | [
"MIT"
] | null | null | null | mvpsite/users/constants.py | mianamir/advance_django_rest_framework_project | 3870f2dbe7b585a236928f90c1792cd337ce8911 | [
"MIT"
] | null | null | null | mvpsite/users/constants.py | mianamir/advance_django_rest_framework_project | 3870f2dbe7b585a236928f90c1792cd337ce8911 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
__author__ = "Amir Savvy"
__copyright__ = "Copyright 2021, MVP Vending Machine Project"
__credits__ = ["amir savvy"]
__license__ = "GPL"
__version__ = "1.0.1"
__maintainer__ = "Amir Savvy"
__email__ = "mianamirlahore@gmail.com"
__status__ = "Production"
# User info
TEST_NORMAL_USER_EMAIL = f"n... | 21.111111 | 61 | 0.717105 |
__author__ = "Amir Savvy"
__copyright__ = "Copyright 2021, MVP Vending Machine Project"
__credits__ = ["amir savvy"]
__license__ = "GPL"
__version__ = "1.0.1"
__maintainer__ = "Amir Savvy"
__email__ = "mianamirlahore@gmail.com"
__status__ = "Production"
TEST_NORMAL_USER_EMAIL = f"normal@user.com"
TEST_SUPER_USER_... | true | true |
f70ac738976aa113d492dc6d741bdbfabbc75b3f | 852 | py | Python | air_pollution_death_rate_related/scripts/air_pollution/feature_generating.py | nghitrampham/air_pollution_death_rate_related | 3fd72b9684e8362de5706ba37c1d90b844d4afe0 | [
"MIT"
] | null | null | null | air_pollution_death_rate_related/scripts/air_pollution/feature_generating.py | nghitrampham/air_pollution_death_rate_related | 3fd72b9684e8362de5706ba37c1d90b844d4afe0 | [
"MIT"
] | 15 | 2019-12-10T02:05:58.000Z | 2022-03-12T00:06:38.000Z | air_pollution_death_rate_related/scripts/air_pollution/feature_generating.py | nghitrampham/CSE583_FinalProject | 3fd72b9684e8362de5706ba37c1d90b844d4afe0 | [
"MIT"
] | 1 | 2020-06-04T17:48:21.000Z | 2020-06-04T17:48:21.000Z | """
This module is mainly used to conduct feature engineering for predicting air quality index model
"""
import warnings
import helpers
warnings.filterwarnings('ignore')
if __name__ == '__main__':
PATH = r'air_pollution_death_rate_related/data/data_air_raw/daily_aqi_by_county_'
### use most recent 3 years to ... | 42.6 | 96 | 0.725352 | import warnings
import helpers
warnings.filterwarnings('ignore')
if __name__ == '__main__':
PATH = r'air_pollution_death_rate_related/data/data_air_raw/daily_aqi_by_county_'
s.data_cleaning(RAW_DATA) | true | true |
f70ac98cc6fb632c2f2d00ce1693c59f019da7a1 | 2,537 | py | Python | xlsxwriter/test/comparison/test_autofilter09.py | Aeon1/XlsxWriter | 6871b6c3fe6c294632054ea91f23d9e27068bcc1 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2019-07-25T06:08:09.000Z | 2019-11-01T02:33:56.000Z | xlsxwriter/test/comparison/test_autofilter09.py | Aeon1/XlsxWriter | 6871b6c3fe6c294632054ea91f23d9e27068bcc1 | [
"BSD-2-Clause-FreeBSD"
] | 13 | 2019-07-14T00:29:05.000Z | 2019-11-26T06:16:46.000Z | xlsxwriter/test/comparison/test_autofilter09.py | Aeon1/XlsxWriter | 6871b6c3fe6c294632054ea91f23d9e27068bcc1 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2019, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 28.829545 | 79 | 0.551439 | true | true | |
f70ac9c888e434188cbef3a72ff9b7b53e5fafd7 | 6,079 | py | Python | moai/metadata/didl.py | TPY17/moai | 6a57069489bcbb0d084f3220bfae5b5d7aac945d | [
"BSD-3-Clause"
] | 10 | 2015-05-10T21:23:04.000Z | 2020-07-01T05:49:15.000Z | moai/metadata/didl.py | TPY17/moai | 6a57069489bcbb0d084f3220bfae5b5d7aac945d | [
"BSD-3-Clause"
] | 4 | 2015-01-13T20:53:51.000Z | 2022-03-15T10:28:51.000Z | moai/metadata/didl.py | TPY17/moai | 6a57069489bcbb0d084f3220bfae5b5d7aac945d | [
"BSD-3-Clause"
] | 11 | 2015-04-08T13:29:28.000Z | 2021-06-25T10:31:27.000Z |
from lxml.builder import ElementMaker
from moai.metadata.mods import NL_MODS, XSI_NS
class DIDL(object):
"""A metadata prefix implementing the DARE DIDL metadata format
this format is registered under the name "didl"
Note that this format re-uses oai_dc and mods formats that come with
MOAI b... | 39.474026 | 124 | 0.481165 |
from lxml.builder import ElementMaker
from moai.metadata.mods import NL_MODS, XSI_NS
class DIDL(object):
def __init__(self, prefix, config, db):
self.prefix = prefix
self.config = config
self.db = db
self.ns = {'didl': "urn:mpeg:mpeg21:2002:02-DIDL-NS",
... | true | true |
f70acb1d9d6ab4d5e2a9f26d917e68d79dd1a235 | 4,081 | py | Python | pyleecan/Generator/run_generate_classes.py | stephane-eisen/pyleecan | 8444b8131c9eff11a616da8277fb1f280c8f70e5 | [
"Apache-2.0"
] | 1 | 2021-07-08T01:27:24.000Z | 2021-07-08T01:27:24.000Z | pyleecan/Generator/run_generate_classes.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | null | null | null | pyleecan/Generator/run_generate_classes.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
from os.path import dirname, abspath, normpath, join, realpath
from os import listdir, remove, system
import json
from datetime import datetime
begin = len(normpath(abspath(join(dirname(__file__), "../.."))))
end = len(normpath(abspath(join(dirname(__file__), ".."))))
MAIN_DIR = dir... | 34.880342 | 109 | 0.626562 |
import sys
from os.path import dirname, abspath, normpath, join, realpath
from os import listdir, remove, system
import json
from datetime import datetime
begin = len(normpath(abspath(join(dirname(__file__), "../.."))))
end = len(normpath(abspath(join(dirname(__file__), ".."))))
MAIN_DIR = dirname(realpath(__file__)... | true | true |
f70accc5c7667aed9b51008137aea4509675a89c | 432 | py | Python | CONTENT/DS-n-Algos/ALGO/__PYTHON/word_count.py | Bryan-Guner-Backup/DS-ALGO-OFFICIAL | 2ef3b4518389274da25f526c928d880b4e4ec26f | [
"Apache-2.0"
] | null | null | null | CONTENT/DS-n-Algos/ALGO/__PYTHON/word_count.py | Bryan-Guner-Backup/DS-ALGO-OFFICIAL | 2ef3b4518389274da25f526c928d880b4e4ec26f | [
"Apache-2.0"
] | null | null | null | CONTENT/DS-n-Algos/ALGO/__PYTHON/word_count.py | Bryan-Guner-Backup/DS-ALGO-OFFICIAL | 2ef3b4518389274da25f526c928d880b4e4ec26f | [
"Apache-2.0"
] | null | null | null | file=open("sample.txt","r")
d=dict()
for lines in file:
lines=lines.strip()
lines=lines.lower()
words=lines.split(" ")
for word in words:
if word in d:
d[word]=d[word]+1
else:
d[word]=1
find=str(input("enter the word to count: "))
find=find.lower()... | 22.736842 | 45 | 0.534722 | file=open("sample.txt","r")
d=dict()
for lines in file:
lines=lines.strip()
lines=lines.lower()
words=lines.split(" ")
for word in words:
if word in d:
d[word]=d[word]+1
else:
d[word]=1
find=str(input("enter the word to count: "))
find=find.lower()... | true | true |
f70acd48249c6db38e2012a0abcc3a8d09d9c8f7 | 2,069 | py | Python | pybamm/models/submodels/thermal/x_full/x_full_no_current_collector.py | danieljtait/PyBaMM | f9d6143770e4a01099f06e3574142424730f731a | [
"BSD-3-Clause"
] | null | null | null | pybamm/models/submodels/thermal/x_full/x_full_no_current_collector.py | danieljtait/PyBaMM | f9d6143770e4a01099f06e3574142424730f731a | [
"BSD-3-Clause"
] | null | null | null | pybamm/models/submodels/thermal/x_full/x_full_no_current_collector.py | danieljtait/PyBaMM | f9d6143770e4a01099f06e3574142424730f731a | [
"BSD-3-Clause"
] | null | null | null | #
# Class for full thermal submodel
#
import pybamm
from .base_x_full import BaseModel
class NoCurrentCollector(BaseModel):
"""Class for full x-direction thermal submodel without current collectors
Parameters
----------
param : parameter class
The parameters to use for this submodel
**... | 28.736111 | 78 | 0.569841 |
import pybamm
from .base_x_full import BaseModel
class NoCurrentCollector(BaseModel):
def __init__(self, param):
super().__init__(param)
def set_rhs(self, variables):
T = variables["Cell temperature"]
q = variables["Heat flux"]
Q = variables["Total heating"]
self... | true | true |
f70acd8bcb229f5b9f12c1e63b3ec56b34848bb9 | 1,023 | py | Python | leetcode/array/medium/combinationSum.py | joway/PyAlgorithm | 0420fbcbebad3b746db63b9e9a5878b4af8ad6ac | [
"MIT"
] | 1 | 2016-08-23T14:24:44.000Z | 2016-08-23T14:24:44.000Z | leetcode/array/medium/combinationSum.py | joway/PyAlgorithm | 0420fbcbebad3b746db63b9e9a5878b4af8ad6ac | [
"MIT"
] | null | null | null | leetcode/array/medium/combinationSum.py | joway/PyAlgorithm | 0420fbcbebad3b746db63b9e9a5878b4af8ad6ac | [
"MIT"
] | null | null | null | """ Summary
"""
class Solution(object):
"""
Problem:
https://leetcode.com/problems/combination-sum/
Example:
given candidate set [2, 3, 6, 7] and target 7,
A solution set is:
[
[7],
[2, 2, 3]
]
"""
def combinationSum(self, candidates, t... | 21.765957 | 96 | 0.474096 |
class Solution(object):
def combinationSum(self, candidates, target):
candidates.sort()
rets = []
for i in candidates:
if i > target:
break
elif i == target:
rets.append([i])
else:
rets += ([sorted([i] + x... | true | true |
f70ace3bc9ff4b2e0804d716b66fba3887fa8cf9 | 582 | py | Python | kpop_project/data_preprocessing_execution.py | chunjuihsu/chunjuihsu.github.io | 2256b7d340393351a484215f3d23841944d4b3ea | [
"CC-BY-3.0"
] | null | null | null | kpop_project/data_preprocessing_execution.py | chunjuihsu/chunjuihsu.github.io | 2256b7d340393351a484215f3d23841944d4b3ea | [
"CC-BY-3.0"
] | null | null | null | kpop_project/data_preprocessing_execution.py | chunjuihsu/chunjuihsu.github.io | 2256b7d340393351a484215f3d23841944d4b3ea | [
"CC-BY-3.0"
] | null | null | null | import pandas as pd
import youtube_api_comments_to_mongodb as ym
import text_classification_and_sentiment_analysis as ta
dbpw = 'kpop'
collection_name = 'comments'
data = ym.mongo_to_dataframe(dbpw, collection_name)
allcomments, englishcomments = ta.dataframe_preparation(data)
tt_set, englishcomments =... | 30.631579 | 78 | 0.752577 | import pandas as pd
import youtube_api_comments_to_mongodb as ym
import text_classification_and_sentiment_analysis as ta
dbpw = 'kpop'
collection_name = 'comments'
data = ym.mongo_to_dataframe(dbpw, collection_name)
allcomments, englishcomments = ta.dataframe_preparation(data)
tt_set, englishcomments =... | true | true |
f70acec2724ccc45198a62b6a42519afcda8cad5 | 205 | py | Python | basic-lang-fun/oop.py | diegopacheco/python-playground | 8e6ba427df6922fb578c2328babbf3466687ccbf | [
"Unlicense"
] | null | null | null | basic-lang-fun/oop.py | diegopacheco/python-playground | 8e6ba427df6922fb578c2328babbf3466687ccbf | [
"Unlicense"
] | null | null | null | basic-lang-fun/oop.py | diegopacheco/python-playground | 8e6ba427df6922fb578c2328babbf3466687ccbf | [
"Unlicense"
] | null | null | null | class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return "{" + self.name + " " + str(self.age) + "}"
p1 = Person("John", 36)
print(p1) | 18.636364 | 58 | 0.556098 | class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return "{" + self.name + " " + str(self.age) + "}"
p1 = Person("John", 36)
print(p1) | true | true |
f70acf373ecdb330c0ce11c3f2115bd7f4f066b1 | 6,494 | py | Python | toolbox/sampling/__init__.py | keunhong/toolbox | e8d1dadab4d9ccf8d78fe86ea933819ac6a07fca | [
"MIT"
] | null | null | null | toolbox/sampling/__init__.py | keunhong/toolbox | e8d1dadab4d9ccf8d78fe86ea933819ac6a07fca | [
"MIT"
] | null | null | null | toolbox/sampling/__init__.py | keunhong/toolbox | e8d1dadab4d9ccf8d78fe86ea933819ac6a07fca | [
"MIT"
] | null | null | null | import logging
import random
from typing import List, Tuple
import numpy as np
from skimage.transform import resize
from scipy.ndimage import zoom
from toolbox import images
from toolbox.images import crop, mask_bbox
from .poisson_disk import sample_poisson_uniform
logger = logging.getLogger(__name__)
class PatchT... | 33.474227 | 82 | 0.59963 | import logging
import random
from typing import List, Tuple
import numpy as np
from skimage.transform import resize
from scipy.ndimage import zoom
from toolbox import images
from toolbox.images import crop, mask_bbox
from .poisson_disk import sample_poisson_uniform
logger = logging.getLogger(__name__)
class PatchT... | true | true |
f70acf587d8569458f8fa30ddf05f354f81bb523 | 3,453 | py | Python | SCANNER_FTX_PERP.py | medialandstudio/bias | 9548a2b66c0134c797fa3d00de3711cfef9dbb70 | [
"MIT"
] | null | null | null | SCANNER_FTX_PERP.py | medialandstudio/bias | 9548a2b66c0134c797fa3d00de3711cfef9dbb70 | [
"MIT"
] | null | null | null | SCANNER_FTX_PERP.py | medialandstudio/bias | 9548a2b66c0134c797fa3d00de3711cfef9dbb70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 7 12:02:50 2021
@author: ministudio
"""
from datetime import datetime, timezone
import pandas as pd
import numpy as np
from alive_progress import alive_bar
def get_all_futures(ftx_client):
tickers = ftx_client.fetchMarkets()
list_perp =[... | 37.532609 | 135 | 0.515204 |
from datetime import datetime, timezone
import pandas as pd
import numpy as np
from alive_progress import alive_bar
def get_all_futures(ftx_client):
tickers = ftx_client.fetchMarkets()
list_perp =[]
for ticker in tickers:
if 'PERP' in ticker['id']:
list_perp.append(ticker... | true | true |
f70ad0a021e9df323e1559c8795babc352e2834b | 144 | py | Python | app/http/http_statuses.py | dimamik/AGH_Learning_Cards | bef1ce8e763fb7b21058f918ec6f02be41bb7a11 | [
"PostgreSQL",
"MIT"
] | null | null | null | app/http/http_statuses.py | dimamik/AGH_Learning_Cards | bef1ce8e763fb7b21058f918ec6f02be41bb7a11 | [
"PostgreSQL",
"MIT"
] | null | null | null | app/http/http_statuses.py | dimamik/AGH_Learning_Cards | bef1ce8e763fb7b21058f918ec6f02be41bb7a11 | [
"PostgreSQL",
"MIT"
] | null | null | null | HTTP_OK = 200
HTTP_CREATED = 201
HTTP_NO_CONTENT = 204
HTTP_BAD_REQUEST = 400
HTTP_UNAUTHORIZED = 401
HTTP_NOT_FOUND = 404
HTTP_CONFLICT = 409
| 16 | 23 | 0.798611 | HTTP_OK = 200
HTTP_CREATED = 201
HTTP_NO_CONTENT = 204
HTTP_BAD_REQUEST = 400
HTTP_UNAUTHORIZED = 401
HTTP_NOT_FOUND = 404
HTTP_CONFLICT = 409
| true | true |
f70ad21fcb02d7452db608ef78fa61ed151d9c8f | 1,560 | py | Python | Cryptocurrency/Dashcoin/dash-gbp.py | uberfastman/bitbar-plugins | b61903dc31360d67c63ed24abdba3ba71ace3d56 | [
"MIT"
] | null | null | null | Cryptocurrency/Dashcoin/dash-gbp.py | uberfastman/bitbar-plugins | b61903dc31360d67c63ed24abdba3ba71ace3d56 | [
"MIT"
] | 1 | 2019-11-21T07:31:36.000Z | 2019-11-21T07:31:36.000Z | Cryptocurrency/Dashcoin/dash-gbp.py | uberfastman/bitbar-plugins | b61903dc31360d67c63ed24abdba3ba71ace3d56 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
#
# <bitbar.title>Dashcoin Ticker (£1GBP)</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>impshum</bitbar.author>
# <bitbar.author.github>impshum</bitbar.author.github>
# <bitbar.desc>Displays current Dashcoin price for £1 from Coinmarketcap</bitbar.desc>
# <bitb... | 60 | 494 | 0.830769 |
from urllib import urlopen
url = urlopen('https://coinmarketcap-nexuist.rhcloud.com/api/dash').read()
import json
result = json.loads(url)
def flow():
if result ['change'] > '0':
print (' £%.4f | image=iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAyQACAALwzISXAAAACXBIWXMAAAsTAAALEwEA... | true | true |
f70ad326400c79c347d2103ccb8c135960a427fe | 3,622 | py | Python | e2e/Tests/Consensus/Verification/UnknownInBlockTest.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 66 | 2019-01-14T08:39:52.000Z | 2022-01-06T11:39:15.000Z | e2e/Tests/Consensus/Verification/UnknownInBlockTest.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 228 | 2019-01-16T15:42:44.000Z | 2022-02-05T07:48:07.000Z | e2e/Tests/Consensus/Verification/UnknownInBlockTest.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 19 | 2019-01-14T08:53:04.000Z | 2021-11-03T20:19:28.000Z | #Tests proper handling of Verifications with Transactions which don't exist.
from typing import Dict, List, Any
import json
from pytest import raises
from e2e.Libs.Minisketch import Sketch
from e2e.Classes.Merit.Block import Block
from e2e.Classes.Merit.Merit import Merit
from e2e.Classes.Consensus.VerificationPack... | 35.861386 | 114 | 0.67725 |
from typing import Dict, List, Any
import json
from pytest import raises
from e2e.Libs.Minisketch import Sketch
from e2e.Classes.Merit.Block import Block
from e2e.Classes.Merit.Merit import Merit
from e2e.Classes.Consensus.VerificationPacket import VerificationPacket
from e2e.Meros.RPC import RPC
from e2e.Meros.M... | true | true |
f70ad3439734e192b877fd56e646278509bf7ab3 | 5,191 | py | Python | epytope/Data/pssms/arb/mat/B_4002_10.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/arb/mat/B_4002_10.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/arb/mat/B_4002_10.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | B_4002_10 = {0: {'A': 0.22337100816803507, 'C': -0.08721732138853625, 'E': -0.05776024940539231, 'D': -0.8062336491499029, 'G': -0.22235775138309136, 'F': 0.41616940014979253, 'I': -0.2625598958640791, 'H': -0.2842266678402531, 'K': -0.11806916630138095, 'M': 0.3503963704784862, 'L': -0.11175681610077592, 'N': -0.65597... | 5,191 | 5,191 | 0.695434 | B_4002_10 = {0: {'A': 0.22337100816803507, 'C': -0.08721732138853625, 'E': -0.05776024940539231, 'D': -0.8062336491499029, 'G': -0.22235775138309136, 'F': 0.41616940014979253, 'I': -0.2625598958640791, 'H': -0.2842266678402531, 'K': -0.11806916630138095, 'M': 0.3503963704784862, 'L': -0.11175681610077592, 'N': -0.65597... | true | true |
f70ad3c71c856f0bf20b70565cd7cc3539e3b885 | 1,071 | py | Python | examples/ethercat/ecat_load_save_config.py | ingeniamc/ingenialink-python | 6011931697e48456f5638c2848303aac2e5bcb75 | [
"MIT"
] | 15 | 2017-08-30T13:43:14.000Z | 2022-03-29T07:04:30.000Z | examples/ethercat/ecat_load_save_config.py | ingeniamc/ingenialink-python | 6011931697e48456f5638c2848303aac2e5bcb75 | [
"MIT"
] | 11 | 2017-08-28T11:23:18.000Z | 2022-03-28T23:48:11.000Z | examples/ethercat/ecat_load_save_config.py | ingeniamc/ingenialink-python | 6011931697e48456f5638c2848303aac2e5bcb75 | [
"MIT"
] | 9 | 2017-09-30T08:28:42.000Z | 2022-03-12T19:11:43.000Z | import sys
from ingenialink.ethercat.network import EthercatNetwork
def connect_slave():
net = EthercatNetwork("\\Device\\NPF_{192D1D2F-C684-467D-A637-EC07BD434A63}")
servo = net.connect_to_slave(
target=1,
dictionary='../../resources/dictionaries/cap-net-e_eoe_0.7.1.xdf')
return servo, n... | 28.184211 | 81 | 0.722689 | import sys
from ingenialink.ethercat.network import EthercatNetwork
def connect_slave():
net = EthercatNetwork("\\Device\\NPF_{192D1D2F-C684-467D-A637-EC07BD434A63}")
servo = net.connect_to_slave(
target=1,
dictionary='../../resources/dictionaries/cap-net-e_eoe_0.7.1.xdf')
return servo, n... | true | true |
f70ad3db5e51eb1972ea537132216676ff99ecf8 | 917 | py | Python | test/python/importer/jit_ir/node_import/function-block-arg-adjustment.py | denolf/torch-mlir | d3a4a7f5d40e11f5dc3fb33fcfee4c2305ccb7c3 | [
"Apache-2.0"
] | 213 | 2021-09-24T03:26:53.000Z | 2022-03-30T07:11:48.000Z | test/python/importer/jit_ir/node_import/function-block-arg-adjustment.py | denolf/torch-mlir | d3a4a7f5d40e11f5dc3fb33fcfee4c2305ccb7c3 | [
"Apache-2.0"
] | 247 | 2021-09-23T18:49:45.000Z | 2022-03-31T17:19:02.000Z | test/python/importer/jit_ir/node_import/function-block-arg-adjustment.py | denolf/torch-mlir | d3a4a7f5d40e11f5dc3fb33fcfee4c2305ccb7c3 | [
"Apache-2.0"
] | 68 | 2021-09-23T18:23:20.000Z | 2022-03-29T11:18:58.000Z | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
from utils import create_script_function
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK-LABEL: ... | 36.68 | 124 | 0.652126 |
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
from utils import create_script_function
mb = ModuleBuilder()
mb.import_function(create_script_function("__torch__.refined_block_arg", """
graph(%0 : Float(1, 384)):
return (%0)
"""))
mb.module.operation.print()
print()
| true | true |
f70ad4082dd1bb7084d23df4a8316b5464b670e8 | 198 | py | Python | Rank of a matrix.py | srijithmass/RANK-OF-A-MATRIX | f0b2dacac02159a1385cfa23b180859444013911 | [
"BSD-3-Clause"
] | null | null | null | Rank of a matrix.py | srijithmass/RANK-OF-A-MATRIX | f0b2dacac02159a1385cfa23b180859444013911 | [
"BSD-3-Clause"
] | null | null | null | Rank of a matrix.py | srijithmass/RANK-OF-A-MATRIX | f0b2dacac02159a1385cfa23b180859444013911 | [
"BSD-3-Clause"
] | null | null | null | #Program to find the rank of a matrix.
#Developed by: SRIJITH R
#RegisterNumber: 21004191
import numpy as np
A=np.array([[5,-3,-10],[2,2,-3],[-3,-1,5]])
val=np.linalg.matrix_rank(A)
print(val) | 28.285714 | 44 | 0.676768 |
import numpy as np
A=np.array([[5,-3,-10],[2,2,-3],[-3,-1,5]])
val=np.linalg.matrix_rank(A)
print(val) | true | true |
f70ad45594920c02ebd62ebd037cc86e54c3965b | 386 | py | Python | OOP_formy/src/pages/file_upload.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | OOP_formy/src/pages/file_upload.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | OOP_formy/src/pages/file_upload.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | """
File upload page using a png file
"""
from selenium.webdriver.common.by import By
from pages.base_page import BasePage
class FileUpload(BasePage):
FILE_UP = (By.ID, 'file-upload-field')
def upload_file(self):
file_up = self.driver.find_element(*self.FILE_UP)
file_up.send_keys('C:/Users/a... | 25.733333 | 102 | 0.735751 |
from selenium.webdriver.common.by import By
from pages.base_page import BasePage
class FileUpload(BasePage):
FILE_UP = (By.ID, 'file-upload-field')
def upload_file(self):
file_up = self.driver.find_element(*self.FILE_UP)
file_up.send_keys('C:/Users/anton/PycharmProjects/Automation_testing/ex... | true | true |
f70ad46c0497f4e4a064bac799bd8fe96b0efbdf | 24,834 | py | Python | pandaclient/PdbUtils.py | matthewfeickert/panda-client | 077bb692a6f42ced0b388c96b8fd64ca032d6df7 | [
"Apache-2.0"
] | 7 | 2016-01-26T21:37:26.000Z | 2020-09-10T07:44:54.000Z | pandaclient/PdbUtils.py | matthewfeickert/panda-client | 077bb692a6f42ced0b388c96b8fd64ca032d6df7 | [
"Apache-2.0"
] | 12 | 2017-10-11T09:15:01.000Z | 2021-11-17T00:23:18.000Z | pandaclient/PdbUtils.py | matthewfeickert/panda-client | 077bb692a6f42ced0b388c96b8fd64ca032d6df7 | [
"Apache-2.0"
] | 9 | 2017-07-20T08:06:36.000Z | 2021-11-15T04:22:06.000Z | import os
import re
import sys
import time
import datetime
from .MiscUtils import commands_get_status_output
try:
long()
except Exception:
long = int
from . import PLogger
from .LocalJobSpec import LocalJobSpec
from .LocalJobsetSpec import LocalJobsetSpec
class PdbProxy:
# constructor
def __init__(se... | 32.168394 | 176 | 0.573488 | import os
import re
import sys
import time
import datetime
from .MiscUtils import commands_get_status_output
try:
long()
except Exception:
long = int
from . import PLogger
from .LocalJobSpec import LocalJobSpec
from .LocalJobsetSpec import LocalJobsetSpec
class PdbProxy:
def __init__(self,verbose=Fa... | true | true |
f70ad47ffabe1481941f0bc8e4a61baa6b6b05a1 | 1,012 | py | Python | examples/projections/azim/azim_gnomonic.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 326 | 2019-02-13T09:33:39.000Z | 2022-03-25T17:24:05.000Z | examples/projections/azim/azim_gnomonic.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 1,153 | 2019-01-22T19:14:32.000Z | 2022-03-31T22:07:03.000Z | examples/projections/azim/azim_gnomonic.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 160 | 2019-02-10T15:24:19.000Z | 2022-03-31T09:07:41.000Z | r"""
Gnomonic
========
The point of perspective of the gnomonic projection lies at the center of the
earth. As a consequence great circles (orthodromes) on the surface of the Earth
are displayed as straight lines, which makes it suitable for distance
estimation for navigational purposes. It is neither conformal nor eq... | 38.923077 | 79 | 0.737154 | import pygmt
fig = pygmt.Figure()
fig.coast(projection="F-90/15/12c", region="g", frame="20g20", land="gray")
fig.show()
| true | true |
f70ad5093842eab9fb077c1fdda2fe3c11e10e3c | 656 | py | Python | Data Science salary prediction/FlaskAPI/app.py | negiaditya/PROJECTS-Data_Science | d26e1fdfc6ce51f02e65c4dbca3edfb5cd97f0a1 | [
"Apache-2.0"
] | null | null | null | Data Science salary prediction/FlaskAPI/app.py | negiaditya/PROJECTS-Data_Science | d26e1fdfc6ce51f02e65c4dbca3edfb5cd97f0a1 | [
"Apache-2.0"
] | null | null | null | Data Science salary prediction/FlaskAPI/app.py | negiaditya/PROJECTS-Data_Science | d26e1fdfc6ce51f02e65c4dbca3edfb5cd97f0a1 | [
"Apache-2.0"
] | null | null | null | import flask
from flask import Flask,jsonify,request
import json
from data_input import data_in
import numpy as np
import pickle
def load_models():
file_name = './models/model_file.p'
with open(file_name,'rb') as pickled:
data = pickle.load(pickled)
model = data['model']
return model
app = Flask(__name__)
@... | 21.16129 | 48 | 0.72561 | import flask
from flask import Flask,jsonify,request
import json
from data_input import data_in
import numpy as np
import pickle
def load_models():
file_name = './models/model_file.p'
with open(file_name,'rb') as pickled:
data = pickle.load(pickled)
model = data['model']
return model
app = Flask(__name__)
@... | true | true |
f70ad5c86243064fffc2399ecd32d4857976c4ce | 1,585 | py | Python | system_tests/conftest.py | Juliana-Morais/data-attribute-recommendation-python-sdk | 95afcfff97ec4f71c5bf10953c0dfa813635636e | [
"Apache-2.0"
] | null | null | null | system_tests/conftest.py | Juliana-Morais/data-attribute-recommendation-python-sdk | 95afcfff97ec4f71c5bf10953c0dfa813635636e | [
"Apache-2.0"
] | null | null | null | system_tests/conftest.py | Juliana-Morais/data-attribute-recommendation-python-sdk | 95afcfff97ec4f71c5bf10953c0dfa813635636e | [
"Apache-2.0"
] | null | null | null | import os
import pytest
from sap.aibus.dar.client.data_manager_client import DataManagerClient
from sap.aibus.dar.client.inference_client import InferenceClient
from sap.aibus.dar.client.model_manager_client import ModelManagerClient
from sap.aibus.dar.client.util.credentials import OnlineCredentialsSource
from sap.a... | 25.15873 | 81 | 0.796215 | import os
import pytest
from sap.aibus.dar.client.data_manager_client import DataManagerClient
from sap.aibus.dar.client.inference_client import InferenceClient
from sap.aibus.dar.client.model_manager_client import ModelManagerClient
from sap.aibus.dar.client.util.credentials import OnlineCredentialsSource
from sap.a... | true | true |
f70ad74e8814bb9a9280d0b92fbb15dd2c7d28a8 | 12,779 | py | Python | parse_scripts/parquet_parsers/galaxy_to_parquet.py | lfdversluis/wta-tools | e9d505df03fff9bb57208dfb82212977ef5e7ca2 | [
"Apache-2.0"
] | 3 | 2019-08-19T10:38:36.000Z | 2020-06-18T10:36:36.000Z | parse_scripts/parquet_parsers/galaxy_to_parquet.py | lfdversluis/wta-tools | e9d505df03fff9bb57208dfb82212977ef5e7ca2 | [
"Apache-2.0"
] | 8 | 2020-02-12T09:53:53.000Z | 2021-03-29T11:16:20.000Z | parse_scripts/parquet_parsers/galaxy_to_parquet.py | lfdversluis/wta-tools | e9d505df03fff9bb57208dfb82212977ef5e7ca2 | [
"Apache-2.0"
] | 2 | 2020-06-17T08:46:02.000Z | 2020-11-26T11:23:48.000Z | import json
import os
import sys
from datetime import datetime
import numpy as np
import pandas as pd
from objects.task import Task
from objects.workflow import Workflow
from objects.workload import Workload
pd.set_option('display.max_columns', None)
USAGE = 'Usage: python(3) ./galaxy_to_parquet.py galaxy_folder'
N... | 39.686335 | 189 | 0.587683 | import json
import os
import sys
from datetime import datetime
import numpy as np
import pandas as pd
from objects.task import Task
from objects.workflow import Workflow
from objects.workload import Workload
pd.set_option('display.max_columns', None)
USAGE = 'Usage: python(3) ./galaxy_to_parquet.py galaxy_folder'
N... | true | true |
f70ad7a5a099f3526ce640efd8badbc902145d66 | 4,566 | py | Python | DeNN/visualization/gradcam.py | KillerStrike17/PyDeNN | 2f0dfaf3e092a4f995ed30e2f8db946e30724551 | [
"MIT"
] | null | null | null | DeNN/visualization/gradcam.py | KillerStrike17/PyDeNN | 2f0dfaf3e092a4f995ed30e2f8db946e30724551 | [
"MIT"
] | null | null | null | DeNN/visualization/gradcam.py | KillerStrike17/PyDeNN | 2f0dfaf3e092a4f995ed30e2f8db946e30724551 | [
"MIT"
] | null | null | null | import seaborn as sns
import matplotlib.pyplot as plt
import torch
import numpy as np
import cv2
from .cam import GradCAM
# def load_gradcam(images, labels, model, device, target_layers):
def load_gradcam(test, model, device, target_layers,size = 25,classified = True):
_images = []
_target = []
_pred = [... | 33.086957 | 210 | 0.644985 | import seaborn as sns
import matplotlib.pyplot as plt
import torch
import numpy as np
import cv2
from .cam import GradCAM
def load_gradcam(test, model, device, target_layers,size = 25,classified = True):
_images = []
_target = []
_pred = []
model.eval()
with torch.no_grad():
... | true | true |
f70ad7d05a2e436c22816e9e6a1f162afbc6f7d6 | 1,239 | py | Python | tests/common/factories/__init__.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | 2,103 | 2015-01-07T12:47:49.000Z | 2022-03-29T02:38:25.000Z | tests/common/factories/__init__.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | 4,322 | 2015-01-04T17:18:01.000Z | 2022-03-31T17:06:02.000Z | tests/common/factories/__init__.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | 389 | 2015-01-24T04:10:02.000Z | 2022-03-28T08:00:16.000Z | """Factory classes for easily generating test objects."""
from .activation import Activation
from .annotation import Annotation
from .annotation_moderation import AnnotationModeration
from .auth_client import AuthClient, ConfidentialAuthClient
from .auth_ticket import AuthTicket
from .authz_code import AuthzCode
from .... | 25.8125 | 59 | 0.736885 | from .activation import Activation
from .annotation import Annotation
from .annotation_moderation import AnnotationModeration
from .auth_client import AuthClient, ConfidentialAuthClient
from .auth_ticket import AuthTicket
from .authz_code import AuthzCode
from .base import set_session
from .document import Document, Do... | true | true |
f70ad80bd35605612bc45255182035b9ed96ec72 | 26,266 | py | Python | sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | null | null | null | sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | null | null | null | sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import msr... | 44.822526 | 130 | 0.666299 |
import msrest.serialization
from .._generated.models import (
LexicalAnalyzer,
LexicalTokenizer,
AnalyzeRequest,
CustomAnalyzer as _CustomAnalyzer,
PatternAnalyzer as _PatternAnalyzer,
PatternTokenizer as _PatternTokenizer,
SearchResourceEncryptionKey as _SearchResourceEncryptionKey,
... | true | true |
f70ad8f76ec5067e05cba3acf173b8f2bee21594 | 648 | py | Python | train.py | 21171-somesh/Document-Clusturer | 43183c0b44b848e75999cee23e2dd8f8504f3c93 | [
"MIT"
] | 2 | 2019-04-22T18:59:45.000Z | 2019-06-03T15:45:00.000Z | train.py | 21171-somesh/Document-Clusturer | 43183c0b44b848e75999cee23e2dd8f8504f3c93 | [
"MIT"
] | null | null | null | train.py | 21171-somesh/Document-Clusturer | 43183c0b44b848e75999cee23e2dd8f8504f3c93 | [
"MIT"
] | null | null | null | import os
import nltk
import re
from gensim import corpora, models, similarities
from cleaning import clean
def train():
#Loads the data from the local storage
synopses = []
for filename in os.listdir('cnn-stories'):
with open('cnn-stories/' + filename, 'r') as infile:
synopses.append(infile.read())
#Cleans ... | 28.173913 | 110 | 0.746914 | import os
import nltk
import re
from gensim import corpora, models, similarities
from cleaning import clean
def train():
synopses = []
for filename in os.listdir('cnn-stories'):
with open('cnn-stories/' + filename, 'r') as infile:
synopses.append(infile.read())
corpus, dictionary = clean(synopses)
cor... | true | true |
f70ad93723bc0cc59c9e4a2393a8c832aca01a12 | 17,701 | py | Python | google/cloud/aiplatform_v1/services/specialist_pool_service/transports/grpc.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | google/cloud/aiplatform_v1/services/specialist_pool_service/transports/grpc.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/services/specialist_pool_service/transports/grpc.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.032338 | 102 | 0.647591 |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers
from google.api_core import operations_v1
from google.api_core import gapic_v1
import google.auth
from google.auth import credentials as ga_credentials
from google.auth.transp... | true | true |
f70ad9d8555a185e24666047cca27b4352cd70d8 | 1,322 | py | Python | packages/weevely/core/config.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | packages/weevely/core/config.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | packages/weevely/core/config.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | # Base path for log files and sessions
base_path = '~/.weevely/'
# History path
history_path = '~/.weevely/history'
# Session path
sessions_path = '~/.weevely/sessions/'
sessions_ext = '.session'
# Supported Channels
channels = [
# Obfuscated channel inside POST requests introduced
# in Weevely 3.6
'Obf... | 26.979592 | 62 | 0.712557 |
base_path = '~/.weevely/'
history_path = '~/.weevely/history'
sessions_path = '~/.weevely/sessions/'
sessions_ext = '.session'
channels = [
'ObfPost',
]
add_random_param_nocache = False
additional_headers = []
agent_templates_folder_path = 'bd/agents/'
obfuscators_templates_folder_path = ... | true | true |
f70ada9d3216e0fafca4da86d8a5c4c9d69bc80e | 1,428 | py | Python | demos/text_classification/train_text_classification_bert.py | yangheng95/LCF-ABSA | 0eeb4788269a498d34c2aff942e03af78026617e | [
"MIT"
] | 31 | 2019-10-07T03:05:39.000Z | 2020-06-17T01:34:21.000Z | demos/text_classification/train_text_classification_bert.py | yangheng95/LCF-ABSA | 0eeb4788269a498d34c2aff942e03af78026617e | [
"MIT"
] | 7 | 2019-10-16T13:37:52.000Z | 2020-03-30T03:40:56.000Z | demos/text_classification/train_text_classification_bert.py | yangheng95/LCF-ABSA | 0eeb4788269a498d34c2aff942e03af78026617e | [
"MIT"
] | 3 | 2020-01-12T13:03:35.000Z | 2020-06-11T08:26:01.000Z | # -*- coding: utf-8 -*-
# file: train_text_classification_bert.py
# time: 2021/8/5
# author: yangheng <yangheng@m.scnu.edu.cn>
# github: https://github.com/yangheng95
# Copyright (C) 2021. All Rights Reserved.
from pyabsa import TextClassificationTrainer, ClassificationConfigManager, ClassificationDatasetList
... | 47.6 | 101 | 0.734594 |
from pyabsa import TextClassificationTrainer, ClassificationConfigManager, ClassificationDatasetList
from pyabsa.functional import BERTClassificationModelList
classification_config_english = ClassificationConfigManager.get_classification_config_english()
classification_config_english.model = BERTClassifica... | true | true |
f70adcd6f0c2d4785c71d8c4122e7bd260cf8c8b | 1,559 | py | Python | tests/cornac/datasets/test_movielens.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 597 | 2018-07-17T10:59:56.000Z | 2022-03-31T07:59:36.000Z | tests/cornac/datasets/test_movielens.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 137 | 2018-10-12T10:52:11.000Z | 2022-03-04T15:26:49.000Z | tests/cornac/datasets/test_movielens.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 112 | 2018-07-26T04:36:34.000Z | 2022-03-31T02:29:34.000Z | # Copyright 2018 The Cornac 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 ... | 33.891304 | 83 | 0.654907 |
import unittest
import random
import time
from cornac.datasets import movielens
class TestMovieLens(unittest.TestCase):
def test_load_feedback(self):
random.seed(time.time())
if random.random() > 0.8:
ml_100k = movielens.load_feedback()
self.assert... | true | true |
f70add09c6753971def6cb61aa3311e6e70eaed2 | 2,289 | py | Python | store_data.py | jaeckie/covid19-containment-embeddings | e27e63266113231ee399f3a55f76b823d514c6f7 | [
"MIT"
] | null | null | null | store_data.py | jaeckie/covid19-containment-embeddings | e27e63266113231ee399f3a55f76b823d514c6f7 | [
"MIT"
] | null | null | null | store_data.py | jaeckie/covid19-containment-embeddings | e27e63266113231ee399f3a55f76b823d514c6f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 4 15:37:43 2020
@author: moder
"""
import os
from datetime import datetime
import pandas as pd
import urllib.request
from bs4 import BeautifulSoup
user_agent = "user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)"
def scrap_wikipedia_text(url):
request = urllib... | 34.681818 | 95 | 0.606815 |
import os
from datetime import datetime
import pandas as pd
import urllib.request
from bs4 import BeautifulSoup
user_agent = "user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)"
def scrap_wikipedia_text(url):
request = urllib.request.Request(url, data=None, headers={'User-Agent' : user_agent})
html = ur... | true | true |
f70add5cf3160d549f4b2591ff4c1811d0af48bb | 5,189 | py | Python | loss.py | VIROBO-15/yolov1 | b7824a6cc7e89a6c29ab63f636a236d923fa0a64 | [
"MIT"
] | null | null | null | loss.py | VIROBO-15/yolov1 | b7824a6cc7e89a6c29ab63f636a236d923fa0a64 | [
"MIT"
] | null | null | null | loss.py | VIROBO-15/yolov1 | b7824a6cc7e89a6c29ab63f636a236d923fa0a64 | [
"MIT"
] | null | null | null | import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
LAMBDA_COORD = 5
LAMBDA_NOOBJ = 0.5
def calc_loss(inp , target, opt):
if inp.size(0) != target.size(0):
raise Exception("Batch size does not match")
total_loss = torch.tensor(0.0)
#total_loss = total_loss.dtype(te... | 31.259036 | 138 | 0.532665 | import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
LAMBDA_COORD = 5
LAMBDA_NOOBJ = 0.5
def calc_loss(inp , target, opt):
if inp.size(0) != target.size(0):
raise Exception("Batch size does not match")
total_loss = torch.tensor(0.0)
for i in range(inp.size(0))... | true | true |
f70adda29dacc58b9008a96759b8020e2da89fb5 | 149 | py | Python | Basic_API/myproject/basic_api/apps.py | garimazthakur/Learning_Django | 1be5115a4fa9802993824b16ddc1009d1d1fc148 | [
"Apache-2.0"
] | null | null | null | Basic_API/myproject/basic_api/apps.py | garimazthakur/Learning_Django | 1be5115a4fa9802993824b16ddc1009d1d1fc148 | [
"Apache-2.0"
] | null | null | null | Basic_API/myproject/basic_api/apps.py | garimazthakur/Learning_Django | 1be5115a4fa9802993824b16ddc1009d1d1fc148 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class BasicApiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'basic_api'
| 21.285714 | 56 | 0.765101 | from django.apps import AppConfig
class BasicApiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'basic_api'
| true | true |
f70addf5f1bdab1c36a8baa247be36b38e7ec07a | 6,089 | py | Python | law/job/dashboard.py | mschnepf/law | 7e9e54bb13984a22226ed6f2313780af8dde118a | [
"BSD-3-Clause"
] | null | null | null | law/job/dashboard.py | mschnepf/law | 7e9e54bb13984a22226ed6f2313780af8dde118a | [
"BSD-3-Clause"
] | null | null | null | law/job/dashboard.py | mschnepf/law | 7e9e54bb13984a22226ed6f2313780af8dde118a | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
Definition of the job dashboard interface.
"""
__all__ = ["BaseJobDashboard", "NoJobDashboard", "cache_by_status"]
import time
import functools
from contextlib import contextmanager
from abc import ABCMeta, abstractmethod
import six
def cache_by_status(func):
"""
Decorator for :py:me... | 32.736559 | 100 | 0.642634 |
__all__ = ["BaseJobDashboard", "NoJobDashboard", "cache_by_status"]
import time
import functools
from contextlib import contextmanager
from abc import ABCMeta, abstractmethod
import six
def cache_by_status(func):
@functools.wraps(func)
def wrapper(self, job_data, event, job_num, *args, **kwargs):
... | true | true |
f70adf2b66abb9478b88c14aa93f488e2872631b | 5,168 | py | Python | src/ansiblelint/formatters/__init__.py | xoxys/ansible-lint | a009515d2f9cebc147fb02a00ef897526018f1dd | [
"MIT"
] | null | null | null | src/ansiblelint/formatters/__init__.py | xoxys/ansible-lint | a009515d2f9cebc147fb02a00ef897526018f1dd | [
"MIT"
] | null | null | null | src/ansiblelint/formatters/__init__.py | xoxys/ansible-lint | a009515d2f9cebc147fb02a00ef897526018f1dd | [
"MIT"
] | null | null | null | """Output formatters."""
import os
from pathlib import Path
from typing import TYPE_CHECKING, Generic, TypeVar, Union
import rich
if TYPE_CHECKING:
from ansiblelint.errors import MatchError
T = TypeVar('T', bound='BaseFormatter')
class BaseFormatter(Generic[T]):
"""Formatter of ansible-lint output.
Ba... | 35.156463 | 113 | 0.620937 | import os
from pathlib import Path
from typing import TYPE_CHECKING, Generic, TypeVar, Union
import rich
if TYPE_CHECKING:
from ansiblelint.errors import MatchError
T = TypeVar('T', bound='BaseFormatter')
class BaseFormatter(Generic[T]):
def __init__(self, base_dir: Union[str, Path], display_relative_path... | true | true |
f70adf6cbf6163a3f4aa41d1344c3e513b4e7594 | 6,397 | py | Python | src/pymap3d/tests/test_latitude.py | EpicWink/pymap3d | 021e9924f94b2bb5b7148cd00f03d3557619fe27 | [
"BSD-2-Clause"
] | 1 | 2021-05-05T20:17:17.000Z | 2021-05-05T20:17:17.000Z | src/pymap3d/tests/test_latitude.py | EpicWink/pymap3d | 021e9924f94b2bb5b7148cd00f03d3557619fe27 | [
"BSD-2-Clause"
] | null | null | null | src/pymap3d/tests/test_latitude.py | EpicWink/pymap3d | 021e9924f94b2bb5b7148cd00f03d3557619fe27 | [
"BSD-2-Clause"
] | null | null | null | import pytest
from pytest import approx
from math import radians, inf
import pymap3d as pm
@pytest.mark.parametrize(
"geodetic_lat,alt_m,geocentric_lat",
[(0, 0, 0), (90, 0, 90), (-90, 0, -90), (45, 0, 44.80757678), (-45, 0, -44.80757678)],
)
def test_geodetic_alt_geocentric(geodetic_lat, alt_m, geocentric_l... | 36.346591 | 100 | 0.706425 | import pytest
from pytest import approx
from math import radians, inf
import pymap3d as pm
@pytest.mark.parametrize(
"geodetic_lat,alt_m,geocentric_lat",
[(0, 0, 0), (90, 0, 90), (-90, 0, -90), (45, 0, 44.80757678), (-45, 0, -44.80757678)],
)
def test_geodetic_alt_geocentric(geodetic_lat, alt_m, geocentric_l... | true | true |
f70adf83b566478b793627f9a744332eef59285a | 649 | py | Python | py2c/abc/manager.py | timgates42/Py2C | b5c9fd238db589f6d7709482901e33ffebb764eb | [
"BSD-3-Clause"
] | 149 | 2015-01-03T14:21:20.000Z | 2022-03-19T06:23:26.000Z | py2c/abc/manager.py | timgates42/Py2C | b5c9fd238db589f6d7709482901e33ffebb764eb | [
"BSD-3-Clause"
] | 5 | 2019-06-15T18:52:25.000Z | 2021-07-18T18:19:56.000Z | py2c/abc/manager.py | timgates42/Py2C | b5c9fd238db589f6d7709482901e33ffebb764eb | [
"BSD-3-Clause"
] | 62 | 2015-03-02T08:15:31.000Z | 2022-03-14T04:02:35.000Z | """An Abstract Base Class for Managers
"""
import abc
from py2c.utils import verify_attribute
__all__ = ["Manager"]
class Manager(object, metaclass=abc.ABCMeta):
"""Base class of all managers
"""
def __init__(self):
super().__init__()
verify_attribute(self, "options", dict)
@abc.a... | 22.37931 | 73 | 0.617874 |
import abc
from py2c.utils import verify_attribute
__all__ = ["Manager"]
class Manager(object, metaclass=abc.ABCMeta):
def __init__(self):
super().__init__()
verify_attribute(self, "options", dict)
@abc.abstractmethod
def run(self, options, *args, **kwargs):
raise NotImpleme... | true | true |
f70adfb5e0c2020651397d903b579cb71d6d8d6a | 6,408 | py | Python | tsai/data/mixed.py | dnth/tsai | 641d5bb75f3aa75889c00a4bb60d96510b4c5605 | [
"Apache-2.0"
] | 1 | 2021-12-03T20:44:55.000Z | 2021-12-03T20:44:55.000Z | tsai/data/mixed.py | dnth/tsai | 641d5bb75f3aa75889c00a4bb60d96510b4c5605 | [
"Apache-2.0"
] | null | null | null | tsai/data/mixed.py | dnth/tsai | 641d5bb75f3aa75889c00a4bb60d96510b4c5605 | [
"Apache-2.0"
] | 1 | 2021-11-14T02:58:25.000Z | 2021-11-14T02:58:25.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/022_data.mixed.ipynb (unless otherwise specified).
__all__ = ['MixedDataLoader', 'MixedDataLoaders', 'get_mixed_dls']
# Cell
from ..imports import *
# Cell
# This implementation of a mixed dataloader is based on a great implementation created by Zach Mueller in this fa... | 38.836364 | 125 | 0.593945 |
__all__ = ['MixedDataLoader', 'MixedDataLoaders', 'get_mixed_dls']
from ..imports import *
from packaging import version
from fastai.data.load import _FakeLoader
from torch.utils.data.dataloader import _MultiProcessingDataLoaderIter, _SingleProcessDataLoaderIter, _DatasetKind
_loaders = (_MultiProcessingDataLo... | true | true |
f70adfb91065c384fd4247793ef097d44b87aa12 | 1,838 | bzl | Python | deps/prebuilt_protoc_deps.bzl | heartless-clown/rules_proto | 99c0d0c7a00c1df7221afc3331b5d859a02c420f | [
"Apache-2.0"
] | 249 | 2018-10-24T21:11:08.000Z | 2022-03-31T03:28:34.000Z | deps/prebuilt_protoc_deps.bzl | heartless-clown/rules_proto | 99c0d0c7a00c1df7221afc3331b5d859a02c420f | [
"Apache-2.0"
] | 147 | 2018-12-05T18:58:13.000Z | 2022-03-26T15:41:07.000Z | deps/prebuilt_protoc_deps.bzl | heartless-clown/rules_proto | 99c0d0c7a00c1df7221afc3331b5d859a02c420f | [
"Apache-2.0"
] | 126 | 2018-11-20T22:34:48.000Z | 2022-03-18T13:42:05.000Z | """
GENERATED FILE - DO NOT EDIT (created via @build_stack_rules_proto//cmd/depsgen)
"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def _maybe(repo_rule, name, **kwargs):
if name not in native.existing_rules():
repo_rule(name = name, **kwargs)
def prebuilt_protoc_deps():
pre... | 27.848485 | 104 | 0.632753 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def _maybe(repo_rule, name, **kwargs):
if name not in native.existing_rules():
repo_rule(name = name, **kwargs)
def prebuilt_protoc_deps():
prebuilt_protoc_linux()
prebuilt_protoc_osx()
prebuilt_protoc_windows()
def p... | true | true |
f70adff244a996e05d8cdfd8c5098172e41ab655 | 30,557 | py | Python | trunk/MOPS_Timings.py | n5iln/railmops | f7d3b446435b31bad8cddf343f18ca7efb9eac10 | [
"Unlicense"
] | 1 | 2015-03-30T12:10:56.000Z | 2015-03-30T12:10:56.000Z | trunk/MOPS_Timings.py | n5iln/railmops | f7d3b446435b31bad8cddf343f18ca7efb9eac10 | [
"Unlicense"
] | null | null | null | trunk/MOPS_Timings.py | n5iln/railmops | f7d3b446435b31bad8cddf343f18ca7efb9eac10 | [
"Unlicense"
] | null | null | null | '''
Timings Class
Arrival and departure times for all Route Sections on a Route on a particular
schedule and shows the time into a section and the time out of a section
Model Operations Processing System. Copyright Brian Fairbairn 2009-2010. Licenced under the EUPL.
You may not use this work except in complia... | 40.526525 | 120 | 0.491148 |
import MOPS_Element
class cTimings(MOPS_Element.cElement):
extract_code = 'select * from timings'
extract_header = 'id|section|schedule|depart_station|arrive_station|planned_depart|planned_arrive\n'
def adtims(self, message):
if self.show_access(message, 'ADTIMS schedule', 'S') !=... | true | true |
f70ae05e1e355304e928e6fc4760453b28642856 | 757 | py | Python | python/test/test_biadjacent.py | EQt/graphidx | 9716488cf29f6235072fc920fa1a473bf88e954f | [
"MIT"
] | 4 | 2020-04-03T15:18:30.000Z | 2022-01-06T15:22:48.000Z | python/test/test_biadjacent.py | EQt/graphidx | 9716488cf29f6235072fc920fa1a473bf88e954f | [
"MIT"
] | null | null | null | python/test/test_biadjacent.py | EQt/graphidx | 9716488cf29f6235072fc920fa1a473bf88e954f | [
"MIT"
] | null | null | null | import numpy as np
from graphidx.idx import BiAdjacent
def square():
head = np.array([0, 0, 1, 2])
tail = np.array([1, 2, 3, 3])
return BiAdjacent(head, tail)
def test_sqare():
neigh = square()
assert repr(neigh) == "BiAdjacent[m = 4, n = 4]"
assert set(neigh[0]) == {1, 2}
assert set(nei... | 23.65625 | 52 | 0.548217 | import numpy as np
from graphidx.idx import BiAdjacent
def square():
head = np.array([0, 0, 1, 2])
tail = np.array([1, 2, 3, 3])
return BiAdjacent(head, tail)
def test_sqare():
neigh = square()
assert repr(neigh) == "BiAdjacent[m = 4, n = 4]"
assert set(neigh[0]) == {1, 2}
assert set(nei... | true | true |
f70ae09d3d78cf87978fb48a1ad8112b54e656d2 | 3,833 | py | Python | src/Products/PluginRegistry/interfaces.py | zopefoundation/Products.PluginRegistry | 5093cec2ef2c0769ac19e854d19acd9cae27c878 | [
"ZPL-2.1"
] | null | null | null | src/Products/PluginRegistry/interfaces.py | zopefoundation/Products.PluginRegistry | 5093cec2ef2c0769ac19e854d19acd9cae27c878 | [
"ZPL-2.1"
] | 13 | 2016-02-27T22:32:34.000Z | 2021-09-21T06:46:05.000Z | src/Products/PluginRegistry/interfaces.py | zopefoundation/Products.PluginRegistry | 5093cec2ef2c0769ac19e854d19acd9cae27c878 | [
"ZPL-2.1"
] | 2 | 2015-04-03T05:26:05.000Z | 2015-10-16T08:22:24.000Z | ##############################################################################
#
# Copyright (c) 2001 Zope Foundation and Contributors
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this
# distribution.
# THIS SOFTWARE IS PROVIDED "AS ... | 31.941667 | 79 | 0.623272 | true | true | |
f70ae09eab8088111ac2aa5d19572f95f48b55f4 | 1,923 | py | Python | tests/test_sock.py | xxNB/gunicorn | fde9fcfaaaa5db628bcb16644de524122ef0f057 | [
"MIT"
] | 1 | 2020-04-03T18:00:08.000Z | 2020-04-03T18:00:08.000Z | tests/test_sock.py | xgfone/gunicorn | 3857ebc4a7ca52cc7ad5a89a62f2cf94519e426b | [
"MIT"
] | 1 | 2016-08-04T09:36:31.000Z | 2016-08-04T09:36:31.000Z | tests/test_sock.py | xgfone/gunicorn | 3857ebc4a7ca52cc7ad5a89a62f2cf94519e426b | [
"MIT"
] | 1 | 2021-02-22T14:46:39.000Z | 2021-02-22T14:46:39.000Z | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
try:
import unittest.mock as mock
except ImportError:
import mock
from gunicorn import sock
@mock.patch('os.stat')
def test_create_sockets_unix_bytes(stat):
conf = mock.Mock(add... | 31.52459 | 76 | 0.703588 |
try:
import unittest.mock as mock
except ImportError:
import mock
from gunicorn import sock
@mock.patch('os.stat')
def test_create_sockets_unix_bytes(stat):
conf = mock.Mock(address=[b'127.0.0.1:8000'])
log = mock.Mock()
with mock.patch.object(sock.UnixSocket, '__init__', lambda *args: None)... | true | true |
f70ae137d2eb886399cbe83df02b37e5d3c5be8f | 11,876 | py | Python | arkane/encorr/ae.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 250 | 2015-06-06T23:32:00.000Z | 2022-03-22T16:45:16.000Z | arkane/encorr/ae.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 1,781 | 2015-05-26T23:52:00.000Z | 2022-03-31T19:07:54.000Z | arkane/encorr/ae.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 161 | 2015-06-02T14:28:59.000Z | 2022-03-02T19:37:14.000Z | #!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 43.028986 | 119 | 0.575867 |
s from previous atom energies')
lines[del_idx_start:del_idx_end] = ae_formatted
break
else:
raise ValueError(f'{key} already exists. Set `overwrite` to True.')
else:
lines[(i... | true | true |
f70ae202c9bbc57106e38b3a87518d56915eb222 | 1,997 | py | Python | guillotina/tests/test_commands.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | guillotina/tests/test_commands.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | guillotina/tests/test_commands.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | import json
import os
from tempfile import mkstemp
import pytest
from guillotina import testing
from guillotina.commands import get_settings
from guillotina.commands.run import RunCommand
DATABASE = os.environ.get('DATABASE', 'DUMMY')
def test_run_command(command_arguments):
_, filepath = mkstemp(suffix='.py')... | 28.126761 | 93 | 0.656485 | import json
import os
from tempfile import mkstemp
import pytest
from guillotina import testing
from guillotina.commands import get_settings
from guillotina.commands.run import RunCommand
DATABASE = os.environ.get('DATABASE', 'DUMMY')
def test_run_command(command_arguments):
_, filepath = mkstemp(suffix='.py')... | true | true |
f70ae20e0c6f0ebe03040dfd7db2eca4e293191c | 37,560 | py | Python | test/test_adaptor_pytorch.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 52 | 2020-08-04T04:31:48.000Z | 2020-11-29T02:34:32.000Z | test/test_adaptor_pytorch.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | null | null | null | test/test_adaptor_pytorch.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 7 | 2020-08-21T01:08:55.000Z | 2020-11-29T03:36:55.000Z | import torch
import torch.nn as nn
import torch.nn.quantized as nnq
from torch.quantization import QuantStub, DeQuantStub
import torchvision
import unittest
import os
from neural_compressor.adaptor import FRAMEWORKS
from neural_compressor.model import MODELS
from neural_compressor.adaptor.pytorch import PyTorchVersionM... | 38.13198 | 125 | 0.557535 | import torch
import torch.nn as nn
import torch.nn.quantized as nnq
from torch.quantization import QuantStub, DeQuantStub
import torchvision
import unittest
import os
from neural_compressor.adaptor import FRAMEWORKS
from neural_compressor.model import MODELS
from neural_compressor.adaptor.pytorch import PyTorchVersionM... | true | true |
f70ae3517f3d8b2963d6bc5c320c15fd5a4c04f2 | 988 | py | Python | Apteki/migrations/0001_initial.py | Daneev/Django_test | 7c0cf5ab28b3faba3cd8dfad60a3194a3eff11d6 | [
"Apache-2.0"
] | null | null | null | Apteki/migrations/0001_initial.py | Daneev/Django_test | 7c0cf5ab28b3faba3cd8dfad60a3194a3eff11d6 | [
"Apache-2.0"
] | null | null | null | Apteki/migrations/0001_initial.py | Daneev/Django_test | 7c0cf5ab28b3faba3cd8dfad60a3194a3eff11d6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-23 16:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Lekars... | 31.870968 | 126 | 0.581984 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Lekarstv',
fields=[
('id', models.AutoField(auto_... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.