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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f729f3ba1a2a0c58defbcfe07cea84dae747f8f4 | 868 | py | Python | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/azure_projects/tests/test_drf_urls.py | kaka-lin/azure-intelligent-edge-patterns | 766833c7c25d2458cec697937be288202d1763bc | [
"MIT"
] | 176 | 2019-07-03T00:20:15.000Z | 2022-03-14T07:51:22.000Z | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/azure_projects/tests/test_drf_urls.py | kaka-lin/azure-intelligent-edge-patterns | 766833c7c25d2458cec697937be288202d1763bc | [
"MIT"
] | 121 | 2019-06-24T20:47:27.000Z | 2022-03-28T02:16:18.000Z | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/azure_projects/tests/test_drf_urls.py | kaka-lin/azure-intelligent-edge-patterns | 766833c7c25d2458cec697937be288202d1763bc | [
"MIT"
] | 144 | 2019-06-18T18:48:43.000Z | 2022-03-31T12:14:46.000Z | """App drf url tests.
"""
from unittest import mock
import pytest
from django.urls import resolve, reverse
from .factories import ProjectFactory
pytestmark = pytest.mark.django_db
@pytest.mark.fast
@mock.patch(
"vision_on_edge.azure_projects.models.Project.validate",
mock.MagicMock(return_value=True),
)
d... | 22.842105 | 83 | 0.684332 |
from unittest import mock
import pytest
from django.urls import resolve, reverse
from .factories import ProjectFactory
pytestmark = pytest.mark.django_db
@pytest.mark.fast
@mock.patch(
"vision_on_edge.azure_projects.models.Project.validate",
mock.MagicMock(return_value=True),
)
def test_project_detail():
... | true | true |
f729f4a05df40e49a35b4c3c584b696d124c3396 | 7,632 | py | Python | salt/log/handlers/sentry_mod.py | andrew-vant/salt | 26fd2bc89e0faaff0fd0176a9896500660204cd5 | [
"Apache-2.0"
] | null | null | null | salt/log/handlers/sentry_mod.py | andrew-vant/salt | 26fd2bc89e0faaff0fd0176a9896500660204cd5 | [
"Apache-2.0"
] | 1 | 2015-09-02T12:49:48.000Z | 2015-09-02T19:22:58.000Z | salt/log/handlers/sentry_mod.py | andrew-vant/salt | 26fd2bc89e0faaff0fd0176a9896500660204cd5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Sentry Logging Handler
======================
.. versionadded:: 0.17.0
This module provides a `Sentry`_ logging handler.
.. admonition:: Note
The `Raven`_ library needs to be installed on the system for this
logging handler to be available.
Config... | 34.378378 | 111 | 0.643082 |
from __future__ import absolute_import
import logging
import salt.loader
from salt.log import LOG_LEVELS
try:
import raven
from raven.handlers.logging import SentryHandler
HAS_RAVEN = True
except ImportError:
HAS_RAVEN = False
log = logging.getLogger(__name__)
__grains__ = {}
__salt__ = {}
__v... | true | true |
f729f5a7091e28863cdde678afbd7609e9b5fc64 | 1,244 | py | Python | tests/syosetsu/fixtures.py | julot/sphinxcontrib-translation-assistant | 44ba6b81efdc77b6ce0b2ee46097ed7ac0c9bbc9 | [
"MIT"
] | 1 | 2017-10-21T07:54:57.000Z | 2017-10-21T07:54:57.000Z | tests/syosetsu/fixtures.py | julot/sphinxcontrib-translation-assistant | 44ba6b81efdc77b6ce0b2ee46097ed7ac0c9bbc9 | [
"MIT"
] | null | null | null | tests/syosetsu/fixtures.py | julot/sphinxcontrib-translation-assistant | 44ba6b81efdc77b6ce0b2ee46097ed7ac0c9bbc9 | [
"MIT"
] | null | null | null | JAPANESE = {
'title': '%プロローグ',
'contents': [
'% |本須 麗乃(もとすうらの)、22歳。',
'% わたしは本が好きだ。',
'$大好きだ。',
'% 三度のご飯より愛してる。',
'%「うっ……」',
],
'notes': {
'pre': [
'%蒼枝と申します。',
'%長編を書くのは初めてです。',
],
'post': [
'%とうとう始めてしまいま... | 20.064516 | 51 | 0.434887 | JAPANESE = {
'title': '%プロローグ',
'contents': [
'% |本須 麗乃(もとすうらの)、22歳。',
'% わたしは本が好きだ。',
'$大好きだ。',
'% 三度のご飯より愛してる。',
'%「うっ……」',
],
'notes': {
'pre': [
'%蒼枝と申します。',
'%長編を書くのは初めてです。',
],
'post': [
'%とうとう始めてしまいま... | true | true |
f729f6695b2e009749a202fe5cfeba04073f23f7 | 4,126 | py | Python | spinqkit/compiler/translator/qiskit_to_spinq.py | SpinQTech/SpinQKit | 2e24826688b2b26cf7efa66fd47f0e7ef883a96c | [
"Apache-2.0"
] | 2 | 2021-12-20T05:19:44.000Z | 2021-12-20T05:21:48.000Z | spinqkit/compiler/translator/qiskit_to_spinq.py | SpinQTech/SpinQKit | 2e24826688b2b26cf7efa66fd47f0e7ef883a96c | [
"Apache-2.0"
] | null | null | null | spinqkit/compiler/translator/qiskit_to_spinq.py | SpinQTech/SpinQKit | 2e24826688b2b26cf7efa66fd47f0e7ef883a96c | [
"Apache-2.0"
] | 1 | 2021-12-20T05:20:35.000Z | 2021-12-20T05:20:35.000Z | # Copyright 2021 SpinQ Technology Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 40.45098 | 213 | 0.579738 |
from typing import Dict, List, Tuple, Optional
from math import pi
import qiskit.circuit as qqc
from spinqkit.model.gates import *
from spinqkit.model import Circuit, UnsupportedQiskitInstructionError
basis_map = {'id': I, 'h': H, 'x': X, 'y': Y, 'z': Z, 'rx': Rx, 'ry': Ry, 'rz': Rz, 't': T, 'tdg': Td, ... | true | true |
f729f681eda6168bd03f4dd8f947ad2edae46e87 | 5,047 | py | Python | polaris/polaris/tests/commands/test_watch_transactions.py | yuriescl/django-polaris | 8806d0e4e8baaddbffbceb3609786d2436b8abe1 | [
"Apache-2.0"
] | 81 | 2019-11-16T21:47:22.000Z | 2022-02-17T07:35:02.000Z | polaris/polaris/tests/commands/test_watch_transactions.py | yuriescl/django-polaris | 8806d0e4e8baaddbffbceb3609786d2436b8abe1 | [
"Apache-2.0"
] | 491 | 2019-11-10T23:44:30.000Z | 2022-03-20T00:25:02.000Z | polaris/polaris/tests/commands/test_watch_transactions.py | yuriescl/django-polaris | 8806d0e4e8baaddbffbceb3609786d2436b8abe1 | [
"Apache-2.0"
] | 89 | 2019-11-18T21:31:01.000Z | 2022-03-28T13:47:41.000Z | import pytest
from copy import deepcopy
from stellar_sdk.keypair import Keypair
from asgiref.sync import async_to_sync
from polaris.models import Transaction, Asset
from polaris.management.commands.watch_transactions import Command
test_module = "polaris.management.commands.watch_transactions"
SUCCESS_PAYMENT_TRANSA... | 44.663717 | 455 | 0.799881 | import pytest
from copy import deepcopy
from stellar_sdk.keypair import Keypair
from asgiref.sync import async_to_sync
from polaris.models import Transaction, Asset
from polaris.management.commands.watch_transactions import Command
test_module = "polaris.management.commands.watch_transactions"
SUCCESS_PAYMENT_TRANSA... | true | true |
f729f7025003e41e6ac53ba5dfc94c8f2008dbff | 2,865 | py | Python | src/ggrc/models/category.py | sriharshakappala/ggrc-core | 7561ce27cd987d73468a44df5b6e2b7425f050ef | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-04-21T12:21:17.000Z | 2019-04-21T12:21:17.000Z | src/ggrc/models/category.py | sriharshakappala/ggrc-core | 7561ce27cd987d73468a44df5b6e2b7425f050ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/models/category.py | sriharshakappala/ggrc-core | 7561ce27cd987d73468a44df5b6e2b7425f050ef | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
# Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By:
# Maintained By:
from ggrc import db
from sqlalchemy.ext.associationproxy import association_proxy
from .categorization import Categorization
from... | 31.483516 | 78 | 0.681675 |
from ggrc import db
from sqlalchemy.ext.associationproxy import association_proxy
from .categorization import Categorization
from .mixins import deferred, Base, Hierarchical
class CategorizedPublishable(object):
def __init__(self, attr_name, type_name):
self.attr_name = attr_name
self.type_name = type_... | true | true |
f729f79dcce70336521e1975dfaa2420b22bc995 | 2,167 | py | Python | benchmarks/operator_benchmark/pt/qbatchnorm_test.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 206 | 2020-11-28T22:56:38.000Z | 2022-03-27T02:33:04.000Z | benchmarks/operator_benchmark/pt/qbatchnorm_test.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 19 | 2020-12-09T23:13:14.000Z | 2022-01-24T23:24:08.000Z | benchmarks/operator_benchmark/pt/qbatchnorm_test.py | jsun94/nimble | e5c899a69677818b1becc58100577441e15ede13 | [
"BSD-3-Clause"
] | 28 | 2020-11-29T15:25:12.000Z | 2022-01-20T02:16:27.000Z |
import operator_benchmark as op_bench
import torch
"""Microbenchmarks for quantized batchnorm operator."""
batchnorm_configs_short = op_bench.config_list(
attr_names=["M", "N", "K"],
attrs=[
[1, 256, 3136],
],
cross_product_configs={
'device': ['cpu'],
'dtype': (torch.qint8,)... | 30.097222 | 93 | 0.653438 |
import operator_benchmark as op_bench
import torch
batchnorm_configs_short = op_bench.config_list(
attr_names=["M", "N", "K"],
attrs=[
[1, 256, 3136],
],
cross_product_configs={
'device': ['cpu'],
'dtype': (torch.qint8,),
},
tags=["short"]
)
class QBatchNormBenchmar... | true | true |
f729f7dcdbbe095d24e280d9ce242d54664e518e | 1,146 | py | Python | 2 - data2graph/evaluateData/changeNames.py | Tocha4/HSM-Solubility | 8a83c1270d739f0c7fbb7decf6202e90e6ebc083 | [
"MIT"
] | null | null | null | 2 - data2graph/evaluateData/changeNames.py | Tocha4/HSM-Solubility | 8a83c1270d739f0c7fbb7decf6202e90e6ebc083 | [
"MIT"
] | null | null | null | 2 - data2graph/evaluateData/changeNames.py | Tocha4/HSM-Solubility | 8a83c1270d739f0c7fbb7decf6202e90e6ebc083 | [
"MIT"
] | null | null | null | import Anton as aen
import numpy as np
import matplotlib.pyplot as plt
import os
from scipy.stats import linregress
def changeCelsius(path):
files = aen.searchfiles(path, '.npy')
files.sort()
for i in files:
fname,name = os.path.split(i)
if 'Celsius' in name:
nm = name.split('C... | 19.1 | 130 | 0.558464 | import Anton as aen
import numpy as np
import matplotlib.pyplot as plt
import os
from scipy.stats import linregress
def changeCelsius(path):
files = aen.searchfiles(path, '.npy')
files.sort()
for i in files:
fname,name = os.path.split(i)
if 'Celsius' in name:
nm = name.split('C... | true | true |
f729f8438327633fc7d4f11f24f1136b21b56cd5 | 2,045 | py | Python | {{ cookiecutter.repo_name }}/{{ cookiecutter.repo_name }}/due.py | gpnlab/cookiecutter-gpnlab | dd6e949fe2a203c77f6ea30e84c95f0306c7b64e | [
"MIT"
] | 213 | 2015-06-22T09:23:32.000Z | 2022-03-17T02:01:53.000Z | {{ cookiecutter.repo_name }}/{{ cookiecutter.repo_name }}/due.py | gpnlab/cookiecutter-gpnlab | dd6e949fe2a203c77f6ea30e84c95f0306c7b64e | [
"MIT"
] | 165 | 2015-06-14T23:23:15.000Z | 2021-09-30T20:06:15.000Z | {{ cookiecutter.repo_name }}/{{ cookiecutter.repo_name }}/due.py | gpnlab/cookiecutter-gpnlab | dd6e949fe2a203c77f6ea30e84c95f0306c7b64e | [
"MIT"
] | 29 | 2015-06-12T20:37:43.000Z | 2021-04-13T12:23:55.000Z | # emacs: at the end of the file
# ex: set sts=4 ts=4 sw=4 et:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
"""
Stub file for a guaranteed safe import of duecredit constructs: if duecredit
is not available.
To use it, place it into your project codebase to be imported, e.g. copy as
... | 27.266667 | 80 | 0.642543 | true | true | |
f729f8abc8999e421fa1f8940589e2a205788fd1 | 6,256 | py | Python | custom_components/aarlo/sensor.py | PysX/home-assistant-conf | 614c5a67314b6c7b8af4237a918a437b79ab460d | [
"MIT"
] | 28 | 2019-05-31T12:30:15.000Z | 2022-03-10T18:54:57.000Z | custom_components/aarlo/sensor.py | PysX/home-assistant-conf | 614c5a67314b6c7b8af4237a918a437b79ab460d | [
"MIT"
] | 5 | 2020-08-14T17:43:48.000Z | 2021-01-08T21:12:45.000Z | custom_components/aarlo/sensor.py | PysX/home-assistant-config | 614c5a67314b6c7b8af4237a918a437b79ab460d | [
"MIT"
] | 2 | 2021-03-31T08:27:19.000Z | 2021-04-30T15:13:24.000Z | """
This component provides HA sensor for Netgear Arlo IP cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.arlo/
"""
import logging
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.const impo... | 33.634409 | 88 | 0.638427 | import logging
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_MONITORED_CONDITIONS,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
TEMP_CELSIUS,
)
from homeassistant.core import callback
from homeassistant.hel... | true | true |
f729f97ebd39e6806075207fe6b3f0af5ed7b553 | 2,783 | py | Python | openstates/openstates-master/openstates/pa/committees.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | openstates/openstates-master/openstates/pa/committees.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | openstates/openstates-master/openstates/pa/committees.py | Jgorsick/Advocacy_Angular | 8906af3ba729b2303880f319d52bce0d6595764c | [
"CC-BY-4.0"
] | null | null | null | import re
from billy.scrape.committees import CommitteeScraper, Committee
import lxml.html
class CommitteeDict(dict):
def __missing__(self, key):
(chamber, committee_name, subcommittee_name) = key
committee = Committee(chamber, committee_name)
if subcommittee_name:
committee... | 36.618421 | 77 | 0.537909 | import re
from billy.scrape.committees import CommitteeScraper, Committee
import lxml.html
class CommitteeDict(dict):
def __missing__(self, key):
(chamber, committee_name, subcommittee_name) = key
committee = Committee(chamber, committee_name)
if subcommittee_name:
committee... | true | true |
f729f9f23dfeec7bda100bb4d12668df62d6b044 | 460 | py | Python | output/models/nist_data/list_pkg/any_uri/schema_instance/nistschema_sv_iv_list_any_uri_length_2_xsd/nistschema_sv_iv_list_any_uri_length_2.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/list_pkg/any_uri/schema_instance/nistschema_sv_iv_list_any_uri_length_2_xsd/nistschema_sv_iv_list_any_uri_length_2.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/list_pkg/any_uri/schema_instance/nistschema_sv_iv_list_any_uri_length_2_xsd/nistschema_sv_iv_list_any_uri_length_2.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import List
__NAMESPACE__ = "NISTSchema-SV-IV-list-anyURI-length-2-NS"
@dataclass
class NistschemaSvIvListAnyUriLength2:
class Meta:
name = "NISTSchema-SV-IV-list-anyURI-length-2"
namespace = "NISTSchema-SV-IV-list-anyURI-length-2-NS"
valu... | 23 | 62 | 0.636957 | from dataclasses import dataclass, field
from typing import List
__NAMESPACE__ = "NISTSchema-SV-IV-list-anyURI-length-2-NS"
@dataclass
class NistschemaSvIvListAnyUriLength2:
class Meta:
name = "NISTSchema-SV-IV-list-anyURI-length-2"
namespace = "NISTSchema-SV-IV-list-anyURI-length-2-NS"
valu... | true | true |
f729fa6181d9109b928cc1ef1836cc6217b4d5fe | 8,853 | py | Python | commands/settings.py | FunTa3y/sfuakefzu1 | 63cec021bc8e1b1321568c711388095837b81ec1 | [
"Apache-2.0"
] | 1 | 2022-03-06T05:40:59.000Z | 2022-03-06T05:40:59.000Z | commands/settings.py | FunTa3y/sfuakefzu1 | 63cec021bc8e1b1321568c711388095837b81ec1 | [
"Apache-2.0"
] | null | null | null | commands/settings.py | FunTa3y/sfuakefzu1 | 63cec021bc8e1b1321568c711388095837b81ec1 | [
"Apache-2.0"
] | null | null | null | """
Здесь собраны все команды настроек
"""
import json
from vkbottle.user import Blueprint, Message
from utils.edit_msg import edit_msg
from utils.emojis import ENABLED, DISABLED, ERROR
from filters import ForEveryoneRule
bp = Blueprint("Settings command")
@bp.on.message(ForEveryoneRule("settings"), ... | 32.788889 | 80 | 0.544448 | import json
from vkbottle.user import Blueprint, Message
from utils.edit_msg import edit_msg
from utils.emojis import ENABLED, DISABLED, ERROR
from filters import ForEveryoneRule
bp = Blueprint("Settings command")
@bp.on.message(ForEveryoneRule("settings"), text="<prefix>для всех <command>")
async def ... | true | true |
f729fb1ebee6b643883c68219d68f5f7837e9319 | 1,636 | py | Python | api_client/python/grr_api_client/types.py | isabella232/grr | db43c7df6eccd6696a5ad3ba8a338088b289d8b1 | [
"Apache-2.0"
] | null | null | null | api_client/python/grr_api_client/types.py | isabella232/grr | db43c7df6eccd6696a5ad3ba8a338088b289d8b1 | [
"Apache-2.0"
] | 1 | 2021-02-23T10:13:00.000Z | 2021-02-23T10:13:00.000Z | api_client/python/grr_api_client/types.py | isabella232/grr | db43c7df6eccd6696a5ad3ba8a338088b289d8b1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Types-related part of GRR API client library."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from typing import Any
from grr_api_client import errors
from grr_api_client import utils
from grr_response_proto import flows_pb2
... | 27.728814 | 73 | 0.732885 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from typing import Any
from grr_api_client import errors
from grr_api_client import utils
from grr_response_proto import flows_pb2
class UnknownFlowName(errors.Error):
pass
class Types(object):
de... | true | true |
f729fb524e45739cedf45c1e9fd71ddbe6b08b2b | 15,311 | py | Python | configs/example/arm/devices.py | zinob15/gem5 | fb2946e314ea9e63c7696ee8023150ed13956582 | [
"BSD-3-Clause"
] | 19 | 2018-07-20T15:08:50.000Z | 2022-03-26T16:15:59.000Z | configs/example/arm/devices.py | zinob15/gem5 | fb2946e314ea9e63c7696ee8023150ed13956582 | [
"BSD-3-Clause"
] | 148 | 2018-07-20T00:58:36.000Z | 2021-11-16T01:52:33.000Z | configs/example/arm/devices.py | zinob15/gem5 | fb2946e314ea9e63c7696ee8023150ed13956582 | [
"BSD-3-Clause"
] | 10 | 2019-01-10T03:01:30.000Z | 2022-01-21T18:36:18.000Z | # Copyright (c) 2016-2017, 2019, 2021 Arm Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of t... | 35.689977 | 79 | 0.640585 |
import m5
from m5.objects import *
m5.util.addToPath('../../')
from common.Caches import *
from common import ObjectList
have_kvm = "ArmV8KvmCPU" in ObjectList.cpu_list.get_names()
have_fastmodel = "FastModelCortexA76" in ObjectList.cpu_list.get_names()
class L1I(L1_ICache):
t... | true | true |
f729fc3eb1ab171fa0021b34ddb3f3124a367be7 | 3,634 | py | Python | azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_ip_configuration.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_ip_configuration.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-network/azure/mgmt/network/v2015_06_15/models/network_interface_ip_configuration.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 49.108108 | 133 | 0.686021 |
from .sub_resource import SubResource
class NetworkInterfaceIPConfiguration(SubResource):
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'load_balancer_backend_address_pools': {'key': 'properties.loadBalancerBackendAddressPools', 'type': '[BackendAddressPool]'},
'load_b... | true | true |
f729fca17167c275820d551d107bd174590db42d | 6,921 | py | Python | backend/aptitude_32653/settings.py | crowdbotics-apps/aptitude-32653 | 381e5da874f4dd461c90bc9705d6bb4be7adfd0e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/aptitude_32653/settings.py | crowdbotics-apps/aptitude-32653 | 381e5da874f4dd461c90bc9705d6bb4be7adfd0e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/aptitude_32653/settings.py | crowdbotics-apps/aptitude-32653 | 381e5da874f4dd461c90bc9705d6bb4be7adfd0e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for aptitude_32653 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... | 29.576923 | 112 | 0.730675 |
import os
import environ
import logging
from modules.manifest import get_modules
env = environ.Env()
DEBUG = env.bool("DEBUG", default=False)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development se... | true | true |
f729fd1d7a671f40e92ec81c3f4592cf5c2c7299 | 2,125 | py | Python | code-samples/canonical-samples/python/long-running-operation/speech_transcribe_async.py | tswast/gapic-docs-samples | 16976b148fb6eb53a8a685d475dcdb713ceb9e60 | [
"Apache-2.0"
] | null | null | null | code-samples/canonical-samples/python/long-running-operation/speech_transcribe_async.py | tswast/gapic-docs-samples | 16976b148fb6eb53a8a685d475dcdb713ceb9e60 | [
"Apache-2.0"
] | null | null | null | code-samples/canonical-samples/python/long-running-operation/speech_transcribe_async.py | tswast/gapic-docs-samples | 16976b148fb6eb53a8a685d475dcdb713ceb9e60 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2019 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 37.280702 | 76 | 0.720941 |
from google.cloud import speech
from google.cloud.speech import enums
from google.cloud.speech import types
def long_running_recognize_gcs(
gcs_uri='gs://cloud-sample-data/speech/brooklyn.raw',
language_code='en-US'
):
client = speech.SpeechClient()
audio = types.Recognit... | true | true |
f729fe054a7c675d4141710bc2b5a4e5decab527 | 1,812 | py | Python | folders_arranger/folders_arranger.py | devded/Automation-scripts | e3b7e623d5fa20496f98a61f896d54ed8a30b8c4 | [
"MIT"
] | null | null | null | folders_arranger/folders_arranger.py | devded/Automation-scripts | e3b7e623d5fa20496f98a61f896d54ed8a30b8c4 | [
"MIT"
] | null | null | null | folders_arranger/folders_arranger.py | devded/Automation-scripts | e3b7e623d5fa20496f98a61f896d54ed8a30b8c4 | [
"MIT"
] | null | null | null | import shutil
import os
import string
class ArrangeScripts:
def __init__(self, path_to_folder):
self.folders = ['a_e', 'f_j', 'k_o', 'p_t', 'u_z']
self.folder_mapping = {}
for alphabet in list(string.ascii_lowercase):
if alphabet in list('abcde'):
self.folder_ma... | 32.945455 | 97 | 0.616446 | import shutil
import os
import string
class ArrangeScripts:
def __init__(self, path_to_folder):
self.folders = ['a_e', 'f_j', 'k_o', 'p_t', 'u_z']
self.folder_mapping = {}
for alphabet in list(string.ascii_lowercase):
if alphabet in list('abcde'):
self.folder_ma... | true | true |
f729fedf70edfac479931ac38e0c12163c8ee92f | 25,493 | py | Python | nltk/corpus/reader/childes.py | PhanatosZou/nltk | 750e488569b6f80c72ae6ca74eff90eae55e6c4e | [
"Apache-2.0"
] | null | null | null | nltk/corpus/reader/childes.py | PhanatosZou/nltk | 750e488569b6f80c72ae6ca74eff90eae55e6c4e | [
"Apache-2.0"
] | null | null | null | nltk/corpus/reader/childes.py | PhanatosZou/nltk | 750e488569b6f80c72ae6ca74eff90eae55e6c4e | [
"Apache-2.0"
] | null | null | null | # CHILDES XML Corpus Reader
# Copyright (C) 2001-2019 NLTK Project
# Author: Tomonori Nagano <tnagano@gc.cuny.edu>
# Alexis Dimitriadis <A.Dimitriadis@uu.nl>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Corpus reader for the XML version of the CHILDES corpus.
"""
__docformat__ = "... | 40.337025 | 103 | 0.484839 |
__docformat__ = "epytext en"
import re
from collections import defaultdict
from nltk.util import flatten, LazyMap, LazyConcatenation
from nltk.corpus.reader.util import concat
from nltk.corpus.reader.xmldocs import XMLCorpusReader, ElementTree
NS = "http://www.talkbank.org/ns/talkbank"
class CHILDESCorp... | true | true |
f72a01337fef4faaba288b693e58d4c5ca437e37 | 31,822 | py | Python | TCFC/eval/bert_eval_acc.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 21 | 2020-12-16T08:53:38.000Z | 2022-01-21T09:08:55.000Z | TCFC/eval/bert_eval_acc.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 1 | 2020-12-27T07:56:01.000Z | 2020-12-30T05:13:11.000Z | TCFC/eval/bert_eval_acc.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 1 | 2022-02-28T12:19:19.000Z | 2022-02-28T12:19:19.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | 42.829071 | 150 | 0.639683 |
import argparse
import glob
import json
import logging
import os
import random
import shutil
import numpy as np
import torch
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset
from torch.utils.data.distributed import DistributedSampler
from tqdm import tqdm, trang... | true | true |
f72a01605237507418ed31df2bec474d55d68fe7 | 1,246 | py | Python | apm/step05/thinker.py | l0k0ms/TrainingEnvironment | f51837cdaf71c6ec41980b8bd1d28275d26a563b | [
"BSD-3-Clause"
] | 6 | 2018-07-27T15:54:49.000Z | 2020-02-08T01:39:05.000Z | apm/step05/thinker.py | l0k0ms/TrainingEnvironment | f51837cdaf71c6ec41980b8bd1d28275d26a563b | [
"BSD-3-Clause"
] | 1 | 2018-10-18T12:20:04.000Z | 2018-12-10T19:50:36.000Z | apm/step05/thinker.py | l0k0ms/TrainingEnvironment | f51837cdaf71c6ec41980b8bd1d28275d26a563b | [
"BSD-3-Clause"
] | 5 | 2018-09-28T11:40:55.000Z | 2021-02-23T11:25:42.000Z | import requests
from flask import Flask, Response, jsonify
from flask import request as flask_request
from flask_caching import Cache
from ddtrace import tracer, patch
from ddtrace.contrib.flask import TraceMiddleware
from bootstrap import create_app
from models import Thought
from time import sleep
patch(redis=T... | 27.086957 | 99 | 0.724719 | import requests
from flask import Flask, Response, jsonify
from flask import request as flask_request
from flask_caching import Cache
from ddtrace import tracer, patch
from ddtrace.contrib.flask import TraceMiddleware
from bootstrap import create_app
from models import Thought
from time import sleep
patch(redis=T... | true | true |
f72a02cc49ea1d37ac8dfd0596d8c565b17bf8e3 | 8,315 | py | Python | f1tenth-RL/f1tenth-rl/car/car_control.py | SidSong01/Deep_Reinforcement_Learning_on_F1_10th | cd869d52ada91d114fd0a905d47ce2a6982e061e | [
"MIT"
] | null | null | null | f1tenth-RL/f1tenth-rl/car/car_control.py | SidSong01/Deep_Reinforcement_Learning_on_F1_10th | cd869d52ada91d114fd0a905d47ce2a6982e061e | [
"MIT"
] | null | null | null | f1tenth-RL/f1tenth-rl/car/car_control.py | SidSong01/Deep_Reinforcement_Learning_on_F1_10th | cd869d52ada91d114fd0a905d47ce2a6982e061e | [
"MIT"
] | 3 | 2020-12-12T21:31:33.000Z | 2021-03-18T12:40:44.000Z | import rospy
from ackermann_msgs.msg import AckermannDriveStamped
from threading import Thread
import time
import argparse
import numpy as np
try:
from geometry_msgs.msg import PoseStamped
except ImportError:
pass
try:
from car.sensors import Sensors
except ImportError:
from sensors import Sensors
P... | 35.233051 | 131 | 0.626218 | import rospy
from ackermann_msgs.msg import AckermannDriveStamped
from threading import Thread
import time
import argparse
import numpy as np
try:
from geometry_msgs.msg import PoseStamped
except ImportError:
pass
try:
from car.sensors import Sensors
except ImportError:
from sensors import Sensors
P... | true | true |
f72a03452c1744c5931873010c359c8d1fbc0c34 | 2,940 | py | Python | oboe/Note.py | dapatil211/oboe | cd7047c8d71b1a488f7f732cab4beadfe82b26b7 | [
"MIT"
] | 89 | 2020-08-17T23:20:12.000Z | 2021-01-13T15:12:43.000Z | oboe/Note.py | dapatil211/oboe | cd7047c8d71b1a488f7f732cab4beadfe82b26b7 | [
"MIT"
] | 23 | 2020-10-01T00:51:29.000Z | 2021-01-15T10:44:06.000Z | oboe/Note.py | dapatil211/oboe | cd7047c8d71b1a488f7f732cab4beadfe82b26b7 | [
"MIT"
] | 14 | 2020-09-21T17:55:15.000Z | 2021-01-03T20:44:21.000Z | import os
import sys
import regex as re
from oboe.utils import slug_case, md_link, render_markdown, find_tags
from oboe.format import (
format_tags, format_blockrefs, format_highlights, format_links, format_code_blocks
)
from oboe.Link import Link
from oboe import LOG
from oboe import GLOBAL
import copy
class Not... | 31.956522 | 112 | 0.626531 | import os
import sys
import regex as re
from oboe.utils import slug_case, md_link, render_markdown, find_tags
from oboe.format import (
format_tags, format_blockrefs, format_highlights, format_links, format_code_blocks
)
from oboe.Link import Link
from oboe import LOG
from oboe import GLOBAL
import copy
class Not... | true | true |
f72a0347ed4a8c5b147fbe4acb6b6a3b266add9d | 52,525 | py | Python | IRIS_data_download/IRIS_download_support/obspy/clients/fdsn/mass_downloader/download_helpers.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-03-05T01:03:01.000Z | 2020-12-17T05:04:07.000Z | IRIS_data_download/IRIS_download_support/obspy/clients/fdsn/mass_downloader/download_helpers.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 4 | 2021-03-31T19:25:55.000Z | 2021-12-13T20:32:46.000Z | IRIS_data_download/IRIS_download_support/obspy/clients/fdsn/mass_downloader/download_helpers.py | earthinversion/Fnet_IRIS_data_automated_download | 09a6e0c992662feac95744935e038d1c68539fa1 | [
"MIT"
] | 2 | 2020-09-08T19:33:40.000Z | 2021-04-05T09:47:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Helpers for the mass downloader.
Intended to simplify and stabilize the logic of the mass downloader and make
it understandable in the first place.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2014-2015
:license:
GNU Lesser General Public Li... | 42.256637 | 79 | 0.563351 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from future.builtins import *
import collections
import copy
import fnmatch
import itertools
import sys
from multiprocessing.pool import ThreadPool
import os
import time
import timeit
if sys.version_info.m... | true | true |
f72a03a0654ac8bf69ab756f2589b9ba01baa853 | 270 | py | Python | com/web/web_app.py | Alex-Ryj/amazon_backend | 96bdd8aacf2bdb545e430fd9f38298a42714e44a | [
"MIT"
] | 2 | 2019-08-29T17:38:32.000Z | 2020-01-05T04:57:17.000Z | com/web/web_app.py | Alex-Ryj/amazon_backend | 96bdd8aacf2bdb545e430fd9f38298a42714e44a | [
"MIT"
] | 6 | 2021-03-19T03:01:52.000Z | 2022-01-13T01:32:51.000Z | com/web/web_app.py | Alex-Ryj/python_backend | 96bdd8aacf2bdb545e430fd9f38298a42714e44a | [
"MIT"
] | null | null | null | from flask import Flask
import log_config
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route('/post/<int:post_id>')
def show_post(post_id):
# show the post with the given id, the id is an integer
return 'Post %d' % post_id | 20.769231 | 59 | 0.681481 | from flask import Flask
import log_config
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@app.route('/post/<int:post_id>')
def show_post(post_id):
return 'Post %d' % post_id | true | true |
f72a0425cee32a9448bd24310af17396dd221dd4 | 5,716 | py | Python | nuplan/planning/metrics/metric_result.py | MCZhi/nuplan-devkit | 3c4f5b8dcd517b27cfd258915ca5fe5c54e3cb0c | [
"Apache-2.0"
] | null | null | null | nuplan/planning/metrics/metric_result.py | MCZhi/nuplan-devkit | 3c4f5b8dcd517b27cfd258915ca5fe5c54e3cb0c | [
"Apache-2.0"
] | null | null | null | nuplan/planning/metrics/metric_result.py | MCZhi/nuplan-devkit | 3c4f5b8dcd517b27cfd258915ca5fe5c54e3cb0c | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from abc import ABC
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, List, Optional
class MetricStatisticsType(Enum):
MAX: str = 'MAX'
MIN: str = 'MIN'
P90: str = 'P90'
MEAN: str = 'MEAN'
COUNT: str = 'COUNT'
VALUE: str =... | 31.58011 | 107 | 0.609692 | from __future__ import annotations
from abc import ABC
from dataclasses import dataclass
from enum import Enum
from typing import Any, Dict, List, Optional
class MetricStatisticsType(Enum):
MAX: str = 'MAX'
MIN: str = 'MIN'
P90: str = 'P90'
MEAN: str = 'MEAN'
COUNT: str = 'COUNT'
VALUE: str =... | true | true |
f72a07a60d7b9b98104ca5e01aff73e0b860b04e | 8,431 | py | Python | deepvoice3_pytorch/modules.py | tripzero/deepvoice3_pytorch | 6aef4c817745c58fe2fb56d36b533b86bd137fa3 | [
"MIT"
] | 6 | 2019-05-14T09:30:49.000Z | 2020-04-20T07:24:41.000Z | deepvoice3_pytorch/modules.py | theFong/deepvoice3_pytorch | 90027d27dab2889d856f9db9ffaf39d4f70b3067 | [
"MIT"
] | null | null | null | deepvoice3_pytorch/modules.py | theFong/deepvoice3_pytorch | 90027d27dab2889d856f9db9ffaf39d4f70b3067 | [
"MIT"
] | 2 | 2021-07-14T09:04:19.000Z | 2021-10-13T05:27:32.000Z | # coding: utf-8
import torch
from torch import nn
import math
import numpy as np
from torch.nn import functional as F
def position_encoding_init(n_position, d_pos_vec, position_rate=1.0,
sinusoidal=True):
''' Init the sinusoid position encoding table '''
# keep dim 0 for padding t... | 34.838843 | 99 | 0.582493 |
import torch
from torch import nn
import math
import numpy as np
from torch.nn import functional as F
def position_encoding_init(n_position, d_pos_vec, position_rate=1.0,
sinusoidal=True):
position_enc = np.array([
[position_rate * pos / np.power(10000, 2 * (i // 2) / d_... | true | true |
f72a081d8e8207ed9ff9da9bb124d0d211ba5629 | 28,886 | py | Python | python/base_agent/ttad/back_translation/modeling_gpt2.py | boldsort/craftassist | 8058d115a250e30deb60d969b7b1a5fefd6e974c | [
"MIT"
] | 626 | 2019-07-18T18:40:44.000Z | 2022-03-29T17:34:43.000Z | python/base_agent/ttad/back_translation/modeling_gpt2.py | boldsort/craftassist | 8058d115a250e30deb60d969b7b1a5fefd6e974c | [
"MIT"
] | 42 | 2019-07-27T11:04:15.000Z | 2021-02-23T03:15:14.000Z | python/base_agent/ttad/back_translation/modeling_gpt2.py | boldsort/craftassist | 8058d115a250e30deb60d969b7b1a5fefd6e974c | [
"MIT"
] | 89 | 2019-07-19T15:07:39.000Z | 2022-02-15T18:44:24.000Z | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License... | 38.669344 | 149 | 0.616562 |
import logging
import os
import warnings
import torch
import torch.nn as nn
from torch.nn import CrossEntropyLoss
from transformers.modeling_gpt2 import PreTrainedModel, GPT2Config
from transformers.modeling_outputs import (
BaseModelOutputWithPast,
CausalLMOutputWithPast,
GPT2DoubleHeadsMo... | true | true |
f72a08a72a1888f212ceb3df79de2a45c4365d09 | 6,475 | py | Python | test/functional/rpc_bind.py | WFLSCoin/wflscoin | 794eb115845c3e7d6b75cf40031568bf5329ee25 | [
"MIT"
] | null | null | null | test/functional/rpc_bind.py | WFLSCoin/wflscoin | 794eb115845c3e7d6b75cf40031568bf5329ee25 | [
"MIT"
] | null | null | null | test/functional/rpc_bind.py | WFLSCoin/wflscoin | 794eb115845c3e7d6b75cf40031568bf5329ee25 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Wflscoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test running wflscoind with the -rpcbind and -rpcallowip options."""
import sys
from test_framework.... | 49.427481 | 172 | 0.633514 |
import sys
from test_framework.netutil import all_interfaces, addr_to_hex, get_bind_addrs, test_ipv6_local
from test_framework.test_framework import WflscoinTestFramework, SkipTest
from test_framework.util import assert_equal, assert_raises_rpc_error, get_rpc_proxy, rpc_port, rpc_url
class RPCBindTest(WflscoinTe... | true | true |
f72a08a78c04b21dcfa96e85e65cc6f2f670bc47 | 811 | py | Python | tests/test_signed_div.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 6,132 | 2015-08-06T23:24:47.000Z | 2022-03-31T21:49:34.000Z | tests/test_signed_div.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 2,272 | 2015-08-10T08:40:07.000Z | 2022-03-31T23:46:44.000Z | tests/test_signed_div.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 1,155 | 2015-08-06T23:37:39.000Z | 2022-03-31T05:54:11.000Z | import nose
import angr
import subprocess
import sys
import logging
l = logging.getLogger('angr.tests.test_signed_div')
import os
test_location = os.path.dirname(os.path.realpath(__file__))
def test_signed_div():
if not sys.platform.startswith('linux'):
raise nose.SkipTest() # this is not technically ... | 27.965517 | 104 | 0.713933 | import nose
import angr
import subprocess
import sys
import logging
l = logging.getLogger('angr.tests.test_signed_div')
import os
test_location = os.path.dirname(os.path.realpath(__file__))
def test_signed_div():
if not sys.platform.startswith('linux'):
raise nose.SkipTest()
test_bin = os.path.jo... | true | true |
f72a08f672564050206b34774a4683b486883a04 | 1,134 | py | Python | ocrd_anybaseocr/cli/cli.py | syedsaqibbukhari/docanalysis | dfbafa582fb652dffa30fb188190cb98f26116a3 | [
"Apache-2.0"
] | 13 | 2018-11-06T10:18:09.000Z | 2021-12-14T08:14:09.000Z | ocrd_anybaseocr/cli/cli.py | syedsaqibbukhari/docanalysis | dfbafa582fb652dffa30fb188190cb98f26116a3 | [
"Apache-2.0"
] | 34 | 2018-11-06T11:30:21.000Z | 2019-07-31T17:18:30.000Z | ocrd_anybaseocr/cli/cli.py | syedsaqibbukhari/docanalysis | dfbafa582fb652dffa30fb188190cb98f26116a3 | [
"Apache-2.0"
] | 7 | 2018-11-06T11:30:23.000Z | 2021-12-14T08:14:13.000Z | import click
from ocrd.decorators import ocrd_cli_options, ocrd_cli_wrap_processor
from ocrd_anybaseocr.cli.ocrd_anybaseocr_cropping import OcrdAnybaseocrCropper
from ocrd_anybaseocr.cli.ocrd_anybaseocr_deskew import OcrdAnybaseocrDeskewer
from ocrd_anybaseocr.cli.ocrd_anybaseocr_binarize import OcrdAnybaseocrBinarize... | 34.363636 | 97 | 0.826279 | import click
from ocrd.decorators import ocrd_cli_options, ocrd_cli_wrap_processor
from ocrd_anybaseocr.cli.ocrd_anybaseocr_cropping import OcrdAnybaseocrCropper
from ocrd_anybaseocr.cli.ocrd_anybaseocr_deskew import OcrdAnybaseocrDeskewer
from ocrd_anybaseocr.cli.ocrd_anybaseocr_binarize import OcrdAnybaseocrBinarize... | true | true |
f72a0a6137a9d63eef214277f2b6c20c57c75e5e | 23,003 | py | Python | sdks/python/client/argo_workflows/model/github_com_argoproj_labs_argo_dataflow_api_v1alpha1_abstract_volume_source.py | parallel-domain/argo-workflows | c055b48b6e216dcdeb1c9840f14199a72329bdaf | [
"Apache-2.0"
] | 1 | 2022-02-24T01:45:03.000Z | 2022-02-24T01:45:03.000Z | sdks/python/client/argo_workflows/model/github_com_argoproj_labs_argo_dataflow_api_v1alpha1_abstract_volume_source.py | parallel-domain/argo-workflows | c055b48b6e216dcdeb1c9840f14199a72329bdaf | [
"Apache-2.0"
] | 18 | 2022-02-01T23:09:58.000Z | 2022-03-31T23:28:41.000Z | sdks/python/client/argo_workflows/model/github_com_argoproj_labs_argo_dataflow_api_v1alpha1_abstract_volume_source.py | parallel-domain/argo-workflows | c055b48b6e216dcdeb1c9840f14199a72329bdaf | [
"Apache-2.0"
] | null | null | null | """
Argo Workflows API
Argo Workflows is an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes. For more information, please see https://argoproj.github.io/argo-workflows/ # noqa: E501
The version of the OpenAPI document: VERSION
Generated by: https://openapi-g... | 53.495349 | 206 | 0.638221 |
import re
import sys
from argo_workflows.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
fro... | true | true |
f72a0ab6ac97478fa1a78bb583dacb7f9f8e3690 | 1,317 | py | Python | python/network/Foundations-of-Python-Network-Programming/foundations-of-python-network-programming/foundations-of-python-network-programming/python3/13/ehlo.py | bosserbosser/codetest | 987563900d912e891b53eeda8e2cf36f3c769430 | [
"Apache-2.0"
] | 1 | 2018-01-15T08:38:09.000Z | 2018-01-15T08:38:09.000Z | python/network/Foundations-of-Python-Network-Programming/foundations-of-python-network-programming/foundations-of-python-network-programming/python3/13/ehlo.py | bosserbosser/codetest | 987563900d912e891b53eeda8e2cf36f3c769430 | [
"Apache-2.0"
] | null | null | null | python/network/Foundations-of-Python-Network-Programming/foundations-of-python-network-programming/foundations-of-python-network-programming/python3/13/ehlo.py | bosserbosser/codetest | 987563900d912e891b53eeda8e2cf36f3c769430 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# SMTP transmission with manual EHLO - Chapter 13 - ehlo.py
import sys, smtplib, socket
if len(sys.argv) < 4:
print("usage: %s server fromaddr toaddr [toaddr...]" % sys.argv[0])
sys.exit(2)
server, fromaddr, toaddrs = sys.argv[1], sys.argv[2], sys.argv[3:]
message = """To: %s
From: %s
... | 28.021277 | 72 | 0.626424 |
import sys, smtplib, socket
if len(sys.argv) < 4:
print("usage: %s server fromaddr toaddr [toaddr...]" % sys.argv[0])
sys.exit(2)
server, fromaddr, toaddrs = sys.argv[1], sys.argv[2], sys.argv[3:]
message = """To: %s
From: %s
Subject: Test Message from simple.py
Hello,
This is a test message sent to you... | true | true |
f72a0bad6b85d668e5c4ae43b5b676d8ca9196fc | 1,556 | py | Python | setup.py | teakfi/imodels | 0144698c5c9b919b2640cb8e2caac3a9124a2a0e | [
"MIT"
] | null | null | null | setup.py | teakfi/imodels | 0144698c5c9b919b2640cb8e2caac3a9124a2a0e | [
"MIT"
] | null | null | null | setup.py | teakfi/imodels | 0144698c5c9b919b2640cb8e2caac3a9124a2a0e | [
"MIT"
] | null | null | null | import setuptools
from os import path
path_to_repo = path.abspath(path.dirname(__file__))
with open(path.join(path_to_repo, 'readme.md'), encoding='utf-8') as f:
long_description = f.read()
required_pypi = [
'corels==1.1.29', # we only provide a basic wrapper around corels
# optionally requires cvxpy for... | 28.290909 | 71 | 0.595116 | import setuptools
from os import path
path_to_repo = path.abspath(path.dirname(__file__))
with open(path.join(path_to_repo, 'readme.md'), encoding='utf-8') as f:
long_description = f.read()
required_pypi = [
'corels==1.1.29',
'mlxtend>=0.18.0',
'numpy',
'pandas',
'scipy',
'sc... | true | true |
f72a0be1d879b2f7d828562e7d4742f9459fae21 | 1,120 | py | Python | test/test_website_group.py | JeremyTangCD/lm-sdk-python | 2a15e055e5a3f72d2f2e4fb43bdbed203c5a9983 | [
"Apache-2.0"
] | null | null | null | test/test_website_group.py | JeremyTangCD/lm-sdk-python | 2a15e055e5a3f72d2f2e4fb43bdbed203c5a9983 | [
"Apache-2.0"
] | null | null | null | test/test_website_group.py | JeremyTangCD/lm-sdk-python | 2a15e055e5a3f72d2f2e4fb43bdbed203c5a9983 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
LogicMonitor REST API
LogicMonitor is a SaaS-based performance monitoring platform that provides full visibility into complex, hybrid infrastructures, offering granular performance monitoring and actionable data and insights. logicmonitor_sdk enables you to manage your LogicMonitor account... | 27.317073 | 304 | 0.738393 |
from __future__ import absolute_import
import unittest
import logicmonitor_sdk
from logicmonitor_sdk.models.website_group import WebsiteGroup
from logicmonitor_sdk.rest import ApiException
class TestWebsiteGroup(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
... | true | true |
f72a0c82f7cfe696f88c2b9b07cb2123643e2f08 | 22,572 | py | Python | scripts/pl_sequence_train.py | louis2889184/sg2im | 6df2095bf58703c7d6d74bf47535a7cf45690bc0 | [
"Apache-2.0"
] | null | null | null | scripts/pl_sequence_train.py | louis2889184/sg2im | 6df2095bf58703c7d6d74bf47535a7cf45690bc0 | [
"Apache-2.0"
] | null | null | null | scripts/pl_sequence_train.py | louis2889184/sg2im | 6df2095bf58703c7d6d74bf47535a7cf45690bc0 | [
"Apache-2.0"
] | null | null | null | import os
import json
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from collections import OrderedDict
from sg2im.utils import timeit, bool_flag, LossManager
from sg2im.utils import int_tuple, float_tuple, str_tuple
from sg2im.data.vg import... | 37.557404 | 112 | 0.659357 | import os
import json
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader
from collections import OrderedDict
from sg2im.utils import timeit, bool_flag, LossManager
from sg2im.utils import int_tuple, float_tuple, str_tuple
from sg2im.data.vg import... | true | true |
f72a0dd1e2be9b0b1602963b8427cf6c4cd7c37c | 10,533 | py | Python | src/thorax/affine/niftireg/tools/utils.py | MASILab/registration_tutorial | 8e6763fe0a49ae53211c62be113fcc13185f2b19 | [
"MIT"
] | 1 | 2021-07-25T16:24:27.000Z | 2021-07-25T16:24:27.000Z | src/thorax/affine/niftireg/tools/utils.py | MASILab/registration_tutorial | 8e6763fe0a49ae53211c62be113fcc13185f2b19 | [
"MIT"
] | null | null | null | src/thorax/affine/niftireg/tools/utils.py | MASILab/registration_tutorial | 8e6763fe0a49ae53211c62be113fcc13185f2b19 | [
"MIT"
] | null | null | null | import os
import errno
import math
import shutil
def get_range_paral_chunk(total_num_item, chunk_pair):
num_item_each_chunk = int(math.ceil(float(total_num_item) / float(chunk_pair[1])))
range_lower = num_item_each_chunk * (chunk_pair[0] - 1)
# range_upper = num_item_each_chunk * chunk_pair[0] - 1
ran... | 43.168033 | 189 | 0.690686 | import os
import errno
import math
import shutil
def get_range_paral_chunk(total_num_item, chunk_pair):
num_item_each_chunk = int(math.ceil(float(total_num_item) / float(chunk_pair[1])))
range_lower = num_item_each_chunk * (chunk_pair[0] - 1)
range_upper = num_item_each_chunk * chunk_pair[0]
if r... | true | true |
f72a0ecb61686900af2bb5227449d8a70ca7b103 | 104 | py | Python | src/lib/models/fastreid/utils/__init__.py | wisematch/KDMOT | 03be0a148fc5d5a43c13a0427c429305b92e6838 | [
"MIT"
] | null | null | null | src/lib/models/fastreid/utils/__init__.py | wisematch/KDMOT | 03be0a148fc5d5a43c13a0427c429305b92e6838 | [
"MIT"
] | null | null | null | src/lib/models/fastreid/utils/__init__.py | wisematch/KDMOT | 03be0a148fc5d5a43c13a0427c429305b92e6838 | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
@author: sherlock
@contact: sherlockliao01@gmail.com
"""
from .registry import * | 14.857143 | 34 | 0.701923 |
from .registry import * | true | true |
f72a0f17a8dcbb9af0ab216980c0570646e12b4d | 17,842 | py | Python | plaso/cli/log2timeline_tool.py | infosecjosh/plaso | 7b5fc33591c60e89afc231a451449d40e02d8985 | [
"Apache-2.0"
] | null | null | null | plaso/cli/log2timeline_tool.py | infosecjosh/plaso | 7b5fc33591c60e89afc231a451449d40e02d8985 | [
"Apache-2.0"
] | null | null | null | plaso/cli/log2timeline_tool.py | infosecjosh/plaso | 7b5fc33591c60e89afc231a451449d40e02d8985 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""The log2timeline CLI tool."""
from __future__ import unicode_literals
import argparse
import os
import sys
import time
import textwrap
from dfvfs.lib import definitions as dfvfs_definitions
import plaso
# The following import makes sure the output modules are registered.
from plaso impor... | 38.123932 | 80 | 0.729403 |
from __future__ import unicode_literals
import argparse
import os
import sys
import time
import textwrap
from dfvfs.lib import definitions as dfvfs_definitions
import plaso
from plaso import output
from plaso.analyzers.hashers import manager as hashers_manager
from plaso.cli import extraction_tool
from plaso.... | true | true |
f72a117fd491be4a83bc01b0a9c8a1fe778df379 | 1,630 | py | Python | stanCode Projects/campy_projects/bouncing_ball.py | ruby-pan/Stanford-Coding-Projects | c3e5ddb53d2742a745eba22f70b8fb0d24d787e8 | [
"MIT"
] | null | null | null | stanCode Projects/campy_projects/bouncing_ball.py | ruby-pan/Stanford-Coding-Projects | c3e5ddb53d2742a745eba22f70b8fb0d24d787e8 | [
"MIT"
] | null | null | null | stanCode Projects/campy_projects/bouncing_ball.py | ruby-pan/Stanford-Coding-Projects | c3e5ddb53d2742a745eba22f70b8fb0d24d787e8 | [
"MIT"
] | null | null | null | """
File: bouncing_ball.py
Name: Ruby
-------------------------
This file uses campy module to
simulate ball bouncing on a GWindow object
"""
from campy.graphics.gobjects import GOval
from campy.graphics.gwindow import GWindow
from campy.gui.events.timer import pause
from campy.gui.events.mouse import onmou... | 25.46875 | 105 | 0.566258 |
from campy.graphics.gobjects import GOval
from campy.graphics.gwindow import GWindow
from campy.gui.events.timer import pause
from campy.gui.events.mouse import onmouseclicked
VX = 5
DELAY = 10
GRAVITY = 1
SIZE = 20
REDUCE = 0.9
START_X = 30
START_Y = 40
window = GWindow(800, 500, title='bouncing_ball.... | true | true |
f72a12b58edcb73c4679ecca5af53b3f3cb22bd2 | 6,980 | py | Python | pandas/__init__.py | katieyounglove/pandas | 8841969eea43fa34c84c9cdc2d7f286fcc5e76e5 | [
"BSD-3-Clause"
] | null | null | null | pandas/__init__.py | katieyounglove/pandas | 8841969eea43fa34c84c9cdc2d7f286fcc5e76e5 | [
"BSD-3-Clause"
] | null | null | null | pandas/__init__.py | katieyounglove/pandas | 8841969eea43fa34c84c9cdc2d7f286fcc5e76e5 | [
"BSD-3-Clause"
] | null | null | null | # flake8: noqa
__docformat__ = "restructuredtext"
# Let users know if they're missing any of our hard dependencies
hard_dependencies = ("numpy", "pytz", "dateutil")
missing_dependencies = []
for dependency in hard_dependencies:
try:
__import__(dependency)
except ImportError as e:
missing_depe... | 24.751773 | 85 | 0.669198 |
__docformat__ = "restructuredtext"
hard_dependencies = ("numpy", "pytz", "dateutil")
missing_dependencies = []
for dependency in hard_dependencies:
try:
__import__(dependency)
except ImportError as e:
missing_dependencies.append("{0}: {1}".format(dependency, str(e)))
if missing_dependencie... | true | true |
f72a12f058bc37d00289a2d8e5e7ef554d3aedf9 | 2,337 | py | Python | kabutobashi/domain/page/page.py | gsy0911/kabutobashi | 0be36a41333c3fd0cb59b1d35edee7db4de4a989 | [
"MIT"
] | null | null | null | kabutobashi/domain/page/page.py | gsy0911/kabutobashi | 0be36a41333c3fd0cb59b1d35edee7db4de4a989 | [
"MIT"
] | 65 | 2020-06-20T00:33:12.000Z | 2022-03-30T14:41:50.000Z | kabutobashi/domain/page/page.py | gsy0911/kabutobashi | 0be36a41333c3fd0cb59b1d35edee7db4de4a989 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from functools import reduce
from typing import List, Optional, Union
import requests # type: ignore
from bs4 import BeautifulSoup
from kabutobashi.errors import KabutobashiPageError
from .us... | 26.556818 | 65 | 0.619598 | from abc import ABCMeta, abstractmethod
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from functools import reduce
from typing import List, Optional, Union
import requests
from bs4 import BeautifulSoup
from kabutobashi.errors import KabutobashiPageError
from .user_agent impor... | true | true |
f72a1413848ce1eae8308309d1a389688e408204 | 7,059 | py | Python | tests/test_util.py | sthagen/pantsbuild-pex | bffe6c3641b809cd3b20adbc7fdb2cf7e5f54309 | [
"Apache-2.0"
] | null | null | null | tests/test_util.py | sthagen/pantsbuild-pex | bffe6c3641b809cd3b20adbc7fdb2cf7e5f54309 | [
"Apache-2.0"
] | null | null | null | tests/test_util.py | sthagen/pantsbuild-pex | bffe6c3641b809cd3b20adbc7fdb2cf7e5f54309 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import subprocess
from hashlib import sha1
from textwrap import dedent
from pex.common import safe_mkdir, safe_open, temporary_dir, touch
from pex.compatibility import to_bytes
... | 35.832487 | 93 | 0.632243 |
import os
import subprocess
from hashlib import sha1
from textwrap import dedent
from pex.common import safe_mkdir, safe_open, temporary_dir, touch
from pex.compatibility import to_bytes
from pex.pex import PEX
from pex.pex_builder import PEXBuilder
from pex.typing import TYPE_CHECKING, cast
from pex.util import Ca... | true | true |
f72a1466c5c327c241f566cd6b2993fbe8a7d9b2 | 2,373 | py | Python | test/eval_fingerprint.py | arthurtofani/footprint | 572401d4cba3299ae9915fca2a7d08ea1a3a9bc4 | [
"MIT"
] | null | null | null | test/eval_fingerprint.py | arthurtofani/footprint | 572401d4cba3299ae9915fca2a7d08ea1a3a9bc4 | [
"MIT"
] | null | null | null | test/eval_fingerprint.py | arthurtofani/footprint | 572401d4cba3299ae9915fca2a7d08ea1a3a9bc4 | [
"MIT"
] | null | null | null | import unittest
import logging
from footprint.models import Audio
from footprint.models import Project
import footprint.clients as db
import os
import random
import footprint.tokenizers as tokenizers
import footprint.evaluators as evaluators
import librosa
class TestEvalFingerprintDummy(unittest.TestCase):
'''
Tes... | 32.958333 | 140 | 0.747577 | import unittest
import logging
from footprint.models import Audio
from footprint.models import Project
import footprint.clients as db
import os
import random
import footprint.tokenizers as tokenizers
import footprint.evaluators as evaluators
import librosa
class TestEvalFingerprintDummy(unittest.TestCase):
def test... | true | true |
f72a14cfa2d25b558ea211b3bf08c71152c5cdcc | 8,959 | py | Python | src/sage/knots/knot.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/knots/knot.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/knots/knot.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | r"""
Knots
AUTHORS:
- Miguel Angel Marco Buzunariz
- Amit Jamadagni
"""
#*****************************************************************************
# Copyright (C) 2014 Travis Scrimshaw <tscrim at ucdavis.edu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | 30.063758 | 136 | 0.480076 |
from sage.knots.link import Link
from sage.rings.integer import Integer
from sage.rings.finite_rings.integer_mod import Mod
class Knot(Link):
def __init__(self, data, check=True):
Link.__init__(self, data)
if check:
if self.number_of_components() != 1:
raise ... | true | true |
f72a14f414a54cde57d44cf0105f7d6ea3a142f8 | 3,674 | py | Python | matplotlib2tikz/patch.py | jameshensman/matplotlib2tikz | 53cd52529c13b08221f962f1a338d33c055132ee | [
"MIT"
] | 1 | 2021-05-25T20:47:41.000Z | 2021-05-25T20:47:41.000Z | matplotlib2tikz/patch.py | jameshensman/matplotlib2tikz | 53cd52529c13b08221f962f1a338d33c055132ee | [
"MIT"
] | null | null | null | matplotlib2tikz/patch.py | jameshensman/matplotlib2tikz | 53cd52529c13b08221f962f1a338d33c055132ee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
import matplotlib as mpl
from . import path as mypath
def draw_patch(data, obj):
"""Return the PGFPlots code for patches.
"""
# Gather the draw options.
data, draw_options = mypath.get_draw_options(
data, obj.get_edgecolor(), obj.get_facecolor()
)
if isinsta... | 28.929134 | 115 | 0.60724 |
import matplotlib as mpl
from . import path as mypath
def draw_patch(data, obj):
data, draw_options = mypath.get_draw_options(
data, obj.get_edgecolor(), obj.get_facecolor()
)
if isinstance(obj, mpl.patches.Rectangle):
return _draw_rectangle(data, obj, draw_options)
e... | true | true |
f72a15f6519d5b0f2de8510193883522c725a840 | 2,207 | py | Python | run/test_set_get_delete.py | JSeam2/Boopy | fc601e362947242b80bcc5c0a2de838e02ef3f1b | [
"MIT"
] | 3 | 2020-03-18T12:51:01.000Z | 2021-12-01T20:01:17.000Z | run/test_set_get_delete.py | JSeam2/Boopy | fc601e362947242b80bcc5c0a2de838e02ef3f1b | [
"MIT"
] | null | null | null | run/test_set_get_delete.py | JSeam2/Boopy | fc601e362947242b80bcc5c0a2de838e02ef3f1b | [
"MIT"
] | 4 | 2020-02-25T12:27:31.000Z | 2020-06-02T19:49:15.000Z | import os
import time
import subprocess
import signal
import requests
import secrets
print('='*81)
print("Running Integration Test: {}".format(__file__))
nodes = [
['1', '0.0.0.0:8001', '0.0.0.0:81'],
['2', '0.0.0.0:8002', '0.0.0.0:82'],
['3', '0.0.0.0:8003', '0.0.0.0:83'],
['4', '0.0.0.0:8004', '0.0... | 19.882883 | 57 | 0.515632 | import os
import time
import subprocess
import signal
import requests
import secrets
print('='*81)
print("Running Integration Test: {}".format(__file__))
nodes = [
['1', '0.0.0.0:8001', '0.0.0.0:81'],
['2', '0.0.0.0:8002', '0.0.0.0:82'],
['3', '0.0.0.0:8003', '0.0.0.0:83'],
['4', '0.0.0.0:8004', '0.0... | true | true |
f72a1694183b61ee3827e0b4a3909cca8c657eca | 32,592 | py | Python | lib/googlecloudsdk/core/console/console_io.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/console/console_io.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/core/console/console_io.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:23:41.000Z | 2020-07-25T12:23:41.000Z | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.020877 | 80 | 0.665777 |
import logging
import os
import re
import sys
import textwrap
import threading
import time
from googlecloudsdk.core import exceptions
from googlecloudsdk.core import log
from googlecloudsdk.core import properties
from googlecloudsdk.core.console import console_attr
from googlecloudsdk.core.console impor... | true | true |
f72a16a88bd2e7f2a04565212dbdc6829381ba8b | 11,244 | py | Python | src/openfermion/utils/_grid.py | mpharrigan/OpenFermion | ae5bbaed60faa019fae9d47d6e578933874e074d | [
"Apache-2.0"
] | null | null | null | src/openfermion/utils/_grid.py | mpharrigan/OpenFermion | ae5bbaed60faa019fae9d47d6e578933874e074d | [
"Apache-2.0"
] | null | null | null | src/openfermion/utils/_grid.py | mpharrigan/OpenFermion | ae5bbaed60faa019fae9d47d6e578933874e074d | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... | 37.605351 | 81 | 0.596852 |
import itertools
import numpy
import scipy
import scipy.linalg
class OrbitalSpecificationError(Exception):
pass
class Grid:
def __init__(self, dimensions, length, scale):
if not isinstance(dimensions, int) or dimensions <= 0:
raise ValueError(
'dimensions m... | true | true |
f72a1840be2b7b6a8d90b8ea7f88260d3394c345 | 390 | py | Python | api/ver1/offices/strings.py | pcf26536/politico-api | 1c9b8755ddad2baf0bfdeab4aa0674e4197a0d7c | [
"MIT"
] | 1 | 2019-02-22T19:34:32.000Z | 2019-02-22T19:34:32.000Z | api/ver1/offices/strings.py | pcf26536/politico-api | 1c9b8755ddad2baf0bfdeab4aa0674e4197a0d7c | [
"MIT"
] | null | null | null | api/ver1/offices/strings.py | pcf26536/politico-api | 1c9b8755ddad2baf0bfdeab4aa0674e4197a0d7c | [
"MIT"
] | 1 | 2019-02-07T22:12:25.000Z | 2019-02-07T22:12:25.000Z | """ string constants for office module """
fed_type = 'federal'
leg_type = 'legislative'
state_type = 'state'
loc_gov_type = 'local government'
office_type_list = [fed_type, leg_type, state_type, loc_gov_type]
office_id_str = 'Office ID '
office_key = 'office'
prezzo = 'President'
mca = 'Member of County Assem... | 27.857143 | 66 | 0.715385 | fed_type = 'federal'
leg_type = 'legislative'
state_type = 'state'
loc_gov_type = 'local government'
office_type_list = [fed_type, leg_type, state_type, loc_gov_type]
office_id_str = 'Office ID '
office_key = 'office'
prezzo = 'President'
mca = 'Member of County Assembly'
wr = 'Women Representative'
gov = 'Go... | true | true |
f72a18619bff18684364dfb679729a22a85ad5ff | 2,217 | py | Python | tools/telemetry/telemetry/core/platform/android_device.py | Fusion-Rom/android_external_chromium_org | d8b126911c6ea9753e9f526bee5654419e1d0ebd | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2015-08-13T21:04:58.000Z | 2015-08-13T21:04:58.000Z | tools/telemetry/telemetry/core/platform/android_device.py | Fusion-Rom/android_external_chromium_org | d8b126911c6ea9753e9f526bee5654419e1d0ebd | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/telemetry/telemetry/core/platform/android_device.py | Fusion-Rom/android_external_chromium_org | d8b126911c6ea9753e9f526bee5654419e1d0ebd | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T06:34:36.000Z | 2020-11-04T06:34:36.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from telemetry.core import util
from telemetry.core.backends import adb_commands
from telemetry.core.platform import device
from telemetry.cor... | 34.640625 | 79 | 0.738385 |
import logging
from telemetry.core import util
from telemetry.core.backends import adb_commands
from telemetry.core.platform import device
from telemetry.core.platform.profiler import monsoon
class AndroidDevice(device.Device):
def __init__(self, device_id, enable_performance_mode=False):
super(AndroidDevic... | true | true |
f72a1afc1bd1464461d901edc69d6b82a2642d50 | 13,446 | py | Python | test/functional/decodescript.py | IDC-Group/VHKD | 0256ddf1477439ebc84e97132d3673aa61c39b73 | [
"MIT"
] | 3 | 2018-06-23T10:04:45.000Z | 2018-06-25T02:22:01.000Z | test/functional/decodescript.py | IDC-Group/VHKD | 0256ddf1477439ebc84e97132d3673aa61c39b73 | [
"MIT"
] | null | null | null | test/functional/decodescript.py | IDC-Group/VHKD | 0256ddf1477439ebc84e97132d3673aa61c39b73 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The vhkdCoin Core vhkd
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test decoding scripts via decodescript RPC command."""
from test_framework.test_framework import vhkdCoinTe... | 74.7 | 761 | 0.7751 |
from test_framework.test_framework import vhkdCoinTestFramework
from test_framework.util import *
from test_framework.mininode import *
from io import BytesIO
class DecodeScriptTest(vhkdCoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
def dec... | true | true |
f72a1b89963a4a3a6d1bf9e9c6daa16de82b1501 | 177 | py | Python | seglossbias/data/__init__.py | by-liu/SegLossBia | 9cc639c04084cda9d5fb20ea34699db7e0beaf5c | [
"MIT"
] | 18 | 2021-04-20T17:03:20.000Z | 2022-03-12T05:56:24.000Z | seglossbias/data/__init__.py | by-liu/SegLossBia | 9cc639c04084cda9d5fb20ea34699db7e0beaf5c | [
"MIT"
] | null | null | null | seglossbias/data/__init__.py | by-liu/SegLossBia | 9cc639c04084cda9d5fb20ea34699db7e0beaf5c | [
"MIT"
] | 1 | 2021-07-08T17:44:15.000Z | 2021-07-08T17:44:15.000Z | from .retinal_lesion_dataset import RetinalLesionsDataset
from .cityscapes import CityscapesDataset
from .image_folder import ImageFolder
from .build import build_data_pipeline
| 35.4 | 57 | 0.887006 | from .retinal_lesion_dataset import RetinalLesionsDataset
from .cityscapes import CityscapesDataset
from .image_folder import ImageFolder
from .build import build_data_pipeline
| true | true |
f72a1bdff1a726f89b33188978307242dbacf3ef | 8,753 | py | Python | var/spack/repos/builtin/packages/ferret/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-10T13:47:48.000Z | 2019-04-17T13:05:17.000Z | var/spack/repos/builtin/packages/ferret/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 17 | 2019-03-21T15:54:00.000Z | 2022-03-29T19:34:28.000Z | var/spack/repos/builtin/packages/ferret/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 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 *
import os
class Ferret(Package):
"""Ferret is an interactive computer visualization and analysi... | 44.207071 | 102 | 0.540272 |
from spack import *
import os
class Ferret(Package):
homepage = "http://ferret.pmel.noaa.gov/Ferret/home"
url = "https://github.com/NOAA-PMEL/Ferret/archive/v7.6.0.tar.gz"
maintainers = ['RemiLacroix-IDRIS']
version('7.6.0', sha256='69832d740bd44c9eadd198a5de4d96c4c01ae90ae28c2c3414c1bb9f... | true | true |
f72a1d7dd4c80ce0ed01d5ce8dc4f4809a465124 | 212 | py | Python | Webscraping_and_Automation/web-automation.py | Ruban2205/Python-Projects | 6c0444784b3be1356d43c70ca544e01e97158d0a | [
"MIT"
] | 1 | 2022-01-17T06:52:29.000Z | 2022-01-17T06:52:29.000Z | Webscraping_and_Automation/web-automation.py | Ruban2205/Python-Projects | 6c0444784b3be1356d43c70ca544e01e97158d0a | [
"MIT"
] | null | null | null | Webscraping_and_Automation/web-automation.py | Ruban2205/Python-Projects | 6c0444784b3be1356d43c70ca544e01e97158d0a | [
"MIT"
] | null | null | null | from webbot import Browser
import time
web = Browser()
web.go_to('https://www.rubangino.in/')
web.click('ABOUT')
web.click('SKILLS')
web.click('PORTFOLIO')
web.go_to('https://www.rubangino.in/android-app.html')
| 21.2 | 54 | 0.731132 | from webbot import Browser
import time
web = Browser()
web.go_to('https://www.rubangino.in/')
web.click('ABOUT')
web.click('SKILLS')
web.click('PORTFOLIO')
web.go_to('https://www.rubangino.in/android-app.html')
| true | true |
f72a1f0c23b646477e269707c49f7c4f891d2af1 | 446 | py | Python | External/__init__.py | QIB-Sheffield/WEASEL | e4dad345fd6f347cfac990708252844a7cbcd025 | [
"Apache-2.0"
] | 2 | 2021-02-10T09:07:15.000Z | 2021-03-16T17:05:24.000Z | External/__init__.py | QIB-Sheffield/WEASEL | e4dad345fd6f347cfac990708252844a7cbcd025 | [
"Apache-2.0"
] | 102 | 2021-01-20T11:14:21.000Z | 2021-12-12T17:34:42.000Z | External/__init__.py | QIB-Sheffield/WEASEL | e4dad345fd6f347cfac990708252844a7cbcd025 | [
"Apache-2.0"
] | 1 | 2021-01-29T09:28:05.000Z | 2021-01-29T09:28:05.000Z | """
This folder contains 3rd party packages that are used in this Weasel project.
You can find a list of these below with their respective version.
Each one has a folder allocated, which contains their own README.md file with their licensing details (all open-source)
- dcm4che Version 5.23.1
- pyqtgraph Version 0.9.1... | 44.6 | 119 | 0.784753 | true | true | |
f72a205db5af6129fef3b71373688885867a2642 | 285 | py | Python | fbchat_archive_parser/writers/json.py | alvin-c/fbmessenger-visualizer | f89988720b2af79832a60824dce969f20b0ebb59 | [
"MIT"
] | 356 | 2016-01-25T23:57:57.000Z | 2022-02-20T18:39:22.000Z | fbchat_archive_parser/writers/json.py | alvin-c/fbmessenger-visualizer | f89988720b2af79832a60824dce969f20b0ebb59 | [
"MIT"
] | 78 | 2016-05-13T19:41:38.000Z | 2018-11-12T17:55:30.000Z | fbchat_archive_parser/writers/json.py | alvin-c/fbmessenger-visualizer | f89988720b2af79832a60824dce969f20b0ebb59 | [
"MIT"
] | 57 | 2016-09-09T15:19:57.000Z | 2022-03-24T19:29:59.000Z | from __future__ import unicode_literals, absolute_import
from .dict import DictWriter
import json
class JsonWriter(DictWriter):
def serialize_content(self, data):
return json.dumps(data, ensure_ascii=False)
@property
def extension(self):
return 'json'
| 19 | 56 | 0.729825 | from __future__ import unicode_literals, absolute_import
from .dict import DictWriter
import json
class JsonWriter(DictWriter):
def serialize_content(self, data):
return json.dumps(data, ensure_ascii=False)
@property
def extension(self):
return 'json'
| true | true |
f72a21ace7280d3d195e7c570c8971b756c0bb85 | 10,355 | py | Python | tests/user_test.py | maerifat/django-DefectDojo | ba1a415219ff20e8b4e909ef14f750de9b80297e | [
"BSD-3-Clause"
] | null | null | null | tests/user_test.py | maerifat/django-DefectDojo | ba1a415219ff20e8b4e909ef14f750de9b80297e | [
"BSD-3-Clause"
] | 206 | 2020-04-20T16:03:18.000Z | 2022-01-15T23:07:48.000Z | tests/user_test.py | maerifat/django-DefectDojo | ba1a415219ff20e8b4e909ef14f750de9b80297e | [
"BSD-3-Clause"
] | 1 | 2020-12-06T15:44:44.000Z | 2020-12-06T15:44:44.000Z | import time
import unittest
import sys
from pathlib import Path
from base_test_class import BaseTestCase
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver import ActionChains
clas... | 47.068182 | 130 | 0.689039 | import time
import unittest
import sys
from pathlib import Path
from base_test_class import BaseTestCase
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver import ActionChains
clas... | true | true |
f72a21f6c715e3e5ea77580a68578caf14684d15 | 15,231 | py | Python | ginga/canvas/transform.py | profxj/ginga | a5f447b760ac38dafa52181b3f99156545a6f2e7 | [
"BSD-3-Clause"
] | null | null | null | ginga/canvas/transform.py | profxj/ginga | a5f447b760ac38dafa52181b3f99156545a6f2e7 | [
"BSD-3-Clause"
] | 2 | 2017-07-25T15:22:13.000Z | 2020-04-25T19:34:30.000Z | ginga/canvas/transform.py | profxj/ginga | a5f447b760ac38dafa52181b3f99156545a6f2e7 | [
"BSD-3-Clause"
] | 3 | 2018-02-09T20:06:30.000Z | 2020-03-30T02:31:44.000Z | #
# transform.py -- coordinate transforms for Ginga
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import numpy as np
from ginga import trcalc
from ginga.misc import Bunch
__all__ = ['TransformError', 'BaseTransform', 'ComposedTransform',
'In... | 27.743169 | 78 | 0.589653 |
import numpy as np
from ginga import trcalc
from ginga.misc import Bunch
__all__ = ['TransformError', 'BaseTransform', 'ComposedTransform',
'InvertedTransform', 'PassThruTransform',
'WindowNativeTransform', 'CartesianWindowTransform',
'CartesianNativeTransform',
'Rota... | true | true |
f72a2370017c122159ed563919fd31b5e3d7c7ad | 165 | py | Python | Python/Strings/StringSplitAndJoin.py | devansh-pratap-singh/hackerrank-solutions | 227817d90846424cd3078e60b225eb201e906cf9 | [
"MIT"
] | 1 | 2020-10-15T14:03:52.000Z | 2020-10-15T14:03:52.000Z | Python/Strings/StringSplitAndJoin.py | devansh-pratap-singh/HackerRank-Solutions | 227817d90846424cd3078e60b225eb201e906cf9 | [
"MIT"
] | null | null | null | Python/Strings/StringSplitAndJoin.py | devansh-pratap-singh/HackerRank-Solutions | 227817d90846424cd3078e60b225eb201e906cf9 | [
"MIT"
] | null | null | null | def split_and_join(line):
new = line.split(" ")
return "-".join(new)
if __name__ == '__main__':
line = input()
result = split_and_join(line)
print(result) | 20.625 | 31 | 0.654545 | def split_and_join(line):
new = line.split(" ")
return "-".join(new)
if __name__ == '__main__':
line = input()
result = split_and_join(line)
print(result) | true | true |
f72a24ac56b6a4a8bd16cd8ff8d1ab866e7cbece | 263 | py | Python | PyLibvirt/test.py | flyflyinit/libvirt-GUI-using-python | 4793ac8e581e2c75d42cd7966bae75cc792c3522 | [
"MIT"
] | null | null | null | PyLibvirt/test.py | flyflyinit/libvirt-GUI-using-python | 4793ac8e581e2c75d42cd7966bae75cc792c3522 | [
"MIT"
] | null | null | null | PyLibvirt/test.py | flyflyinit/libvirt-GUI-using-python | 4793ac8e581e2c75d42cd7966bae75cc792c3522 | [
"MIT"
] | null | null | null | from PIL import Image,ImageDraw
import os
########### showing the image on the screen
image1 = Image.open('icons/io.png')
drawing_object=ImageDraw.Draw(image1)
drawing_object.rectangle((50,0,190,150), fill = None, outline ='red')
image1.show()
#display(image1) | 23.909091 | 69 | 0.730038 | from PIL import Image,ImageDraw
import os
| true | true |
f72a26135e2d57e4c45bf036bf1bf49ac9d741c1 | 1,804 | py | Python | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/CreateProductTagsRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/CreateProductTagsRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/CreateProductTagsRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.382979 | 100 | 0.745011 |
from aliyunsdkcore.request import RpcRequest
class CreateProductTagsRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Iot', '2018-01-20', 'CreateProductTags','iot')
def get_ProductTags(self):
return self.get_query_params().get('ProductTags')
def set_ProductTags(self,P... | true | true |
f72a263618701ae1fe6cb1a521bcae84e7789cff | 52,716 | py | Python | wildlifecompliance/components/legal_case/serializers.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 1 | 2020-12-07T17:12:40.000Z | 2020-12-07T17:12:40.000Z | wildlifecompliance/components/legal_case/serializers.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 14 | 2020-01-08T08:08:26.000Z | 2021-03-19T22:59:46.000Z | wildlifecompliance/components/legal_case/serializers.py | preranaandure/wildlifecompliance | bc19575f7bccf7e19adadbbaf5d3eda1d1aee4b5 | [
"Apache-2.0"
] | 15 | 2020-01-08T08:02:28.000Z | 2021-11-03T06:48:32.000Z | import datetime
import traceback
import pytz
from rest_framework.fields import CharField
from ledger.accounts.models import EmailUser, Address
from wildlifecompliance.components.legal_case.models import (
LegalCase,
LegalCaseUserAction,
LegalCaseCommsLogEntry,
LegalCasePriority,
LegalCaseRunningSh... | 37.92518 | 114 | 0.612471 | import datetime
import traceback
import pytz
from rest_framework.fields import CharField
from ledger.accounts.models import EmailUser, Address
from wildlifecompliance.components.legal_case.models import (
LegalCase,
LegalCaseUserAction,
LegalCaseCommsLogEntry,
LegalCasePriority,
LegalCaseRunningSh... | true | true |
f72a264bb94bb5718618a67a096c5366fb3374f5 | 2,620 | py | Python | google/cloud/speech/v1p1beta1/speech-v1p1beta1-py/google/cloud/speech_v1p1beta1/types/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/cloud/speech/v1p1beta1/speech-v1p1beta1-py/google/cloud/speech_v1p1beta1/types/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/cloud/speech/v1p1beta1/speech-v1p1beta1-py/google/cloud/speech_v1p1beta1/types/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 28.172043 | 74 | 0.748092 |
from .cloud_speech import (
LongRunningRecognizeMetadata,
LongRunningRecognizeRequest,
LongRunningRecognizeResponse,
RecognitionAudio,
RecognitionConfig,
RecognitionMetadata,
RecognizeRequest,
RecognizeResponse,
SpeakerDiarizationConfig,
SpeechContext,
SpeechRe... | true | true |
f72a26dfc31e2ceb7e66c055421e71cb651c6797 | 3,810 | py | Python | Beams/Cantilever Beam - End Loaded.py | vsriv90/mechanical_engineering | c922cdce1a595e9acb6a87cf415fb3685caf51a3 | [
"MIT"
] | 1 | 2021-11-03T06:37:44.000Z | 2021-11-03T06:37:44.000Z | Beams/Cantilever Beam - End Loaded.py | vsriv90/mechanical_engineering | c922cdce1a595e9acb6a87cf415fb3685caf51a3 | [
"MIT"
] | null | null | null | Beams/Cantilever Beam - End Loaded.py | vsriv90/mechanical_engineering | c922cdce1a595e9acb6a87cf415fb3685caf51a3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Cantilever beams - End Loaded
# 
# In[1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sn # to draw plots
# import plotly.express as px
# import ... | 28.014706 | 125 | 0.645407 |
t pandas as pd
import matplotlib.pyplot as plt
import seaborn as sn
from PIL import Image
f = 700
l = 100
UnitF = str('N')
UnitL = str("mm")
x = [0,l]
y = [0,0]
plt.plot(x, y,label = "Beam", color='green', linewidth = 10,marker='o', markerfacecolor='blue', markersize=15)
plt.legend()
| true | true |
f72a27bac82a4eddc6703adc1c7ebd25659b4aad | 2,192 | py | Python | razor/version.py | SRI-CSL/OCCAM | 8c498301f658fd3c158ffb6aad36dc0dd57c6239 | [
"BSD-3-Clause"
] | 17 | 2015-11-23T17:19:54.000Z | 2022-03-18T23:55:29.000Z | razor/version.py | SRI-CSL/application-specialization | 6e3efd1431195ccb4afd0801caa8cc825931197f | [
"BSD-3-Clause"
] | 58 | 2015-11-26T17:24:12.000Z | 2021-11-30T12:47:31.000Z | razor/version.py | SRI-CSL/application-specialization | 6e3efd1431195ccb4afd0801caa8cc825931197f | [
"BSD-3-Clause"
] | 10 | 2015-09-03T14:54:27.000Z | 2020-11-13T14:02:11.000Z | """
OCCAM
Copyright (c) 2011-2017, SRI International
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of con... | 36.533333 | 86 | 0.764142 |
razor_version = '1.1.2'
| true | true |
f72a27db8ed137ada094f4964a806b163f22f0f6 | 19,877 | py | Python | tests/cases/mount_test.py | RemiCecchinato/girder | 455d5c60d59112b65b45daf51c2d2ccda2e84a9a | [
"Apache-2.0"
] | null | null | null | tests/cases/mount_test.py | RemiCecchinato/girder | 455d5c60d59112b65b45daf51c2d2ccda2e84a9a | [
"Apache-2.0"
] | null | null | null | tests/cases/mount_test.py | RemiCecchinato/girder | 455d5c60d59112b65b45daf51c2d2ccda2e84a9a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
import fuse
import mock
import os
import six
import stat
import tempfile
import threading
import time
from girder.cli import mount
from girder.exceptions import ValidationException
from girder.models.file import File
from girder.models.setting import Setting
from girder.models.u... | 46.118329 | 96 | 0.640992 |
import datetime
import fuse
import mock
import os
import six
import stat
import tempfile
import threading
import time
from girder.cli import mount
from girder.exceptions import ValidationException
from girder.models.file import File
from girder.models.setting import Setting
from girder.models.user import User
from gi... | true | true |
f72a2a7c5923c797d3dd68abb92ef1c14020412e | 199 | py | Python | apirel/users/tests/test_models.py | scottBowles/apirel | 597d66eaf65ed9caced411d10c1d8a51f2b76f8f | [
"MIT"
] | null | null | null | apirel/users/tests/test_models.py | scottBowles/apirel | 597d66eaf65ed9caced411d10c1d8a51f2b76f8f | [
"MIT"
] | 10 | 2022-01-05T01:26:19.000Z | 2022-03-28T02:06:15.000Z | apirel/users/tests/test_models.py | scottBowles/apirel | 597d66eaf65ed9caced411d10c1d8a51f2b76f8f | [
"MIT"
] | null | null | null | import pytest
from apirel.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| 19.9 | 64 | 0.768844 | import pytest
from apirel.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| true | true |
f72a2cdaf83462439b996bbb10ea5e4ee8322bf5 | 22,331 | py | Python | aetros/utils/image.py | aetros/aetros-cli | a2a1f38d6af1660e1e2680c7d413ec2aef45faab | [
"MIT"
] | 120 | 2016-07-26T16:06:14.000Z | 2021-07-19T03:26:07.000Z | aetros/utils/image.py | maxpumperla/aetros-cli | a2a1f38d6af1660e1e2680c7d413ec2aef45faab | [
"MIT"
] | 30 | 2016-08-15T22:21:54.000Z | 2018-03-14T08:52:46.000Z | aetros/utils/image.py | maxpumperla/aetros-cli | a2a1f38d6af1660e1e2680c7d413ec2aef45faab | [
"MIT"
] | 30 | 2016-07-31T20:54:48.000Z | 2019-10-17T11:20:18.000Z | # Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
# BSD 3-clause license
from __future__ import absolute_import
from __future__ import print_function
import math
from six.moves import range
# Find the best implementation available
from aetros.utils.pilutil import imresize
try:
from cStringIO i... | 41.740187 | 451 | 0.579553 |
from __future__ import absolute_import
from __future__ import print_function
import math
from six.moves import range
from aetros.utils.pilutil import imresize
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
import numpy as np
import PIL.Image
SUPPORTED_EX... | true | true |
f72a2d4074dad48939a61e0cf5afc75f21b803b0 | 4,053 | py | Python | configs/Misc/torchvision_imagenet_R_50.py | lkeab/detectron2 | d4d2948aed6c0c73558da10f8647661f61470e37 | [
"Apache-2.0"
] | 4 | 2021-05-24T04:43:33.000Z | 2022-03-29T04:59:31.000Z | configs/Misc/torchvision_imagenet_R_50.py | lkeab/detectron2 | d4d2948aed6c0c73558da10f8647661f61470e37 | [
"Apache-2.0"
] | 1 | 2021-06-16T07:01:43.000Z | 2021-11-09T03:48:47.000Z | configs/Misc/torchvision_imagenet_R_50.py | lkeab/detectron2 | d4d2948aed6c0c73558da10f8647661f61470e37 | [
"Apache-2.0"
] | 2 | 2022-03-13T09:35:32.000Z | 2022-03-29T05:04:08.000Z | """
An example config file to train a ImageNet classifier with detectron2.
Model and dataloader both come from torchvision.
This shows how to use detectron2 as a general engine for any new models and tasks.
To run, use the following command:
python tools/lazyconfig_train_net.py --config-file configs/Misc/torchvision_i... | 29.369565 | 94 | 0.658278 |
import torch
from torch import nn
from torch.nn import functional as F
from omegaconf import OmegaConf
import torchvision
from torchvision.transforms import transforms as T
from torchvision.models.resnet import ResNet, Bottleneck
from fvcore.common.param_scheduler import MultiStepParamScheduler
from detectron2.solve... | true | true |
f72a2ec186c24a531378756e12879ab2a4ae97af | 60,347 | py | Python | python/GafferUI/UIEditor.py | hypothetical-inc/gaffer | 7da631400cfac5399255d23ff296f677e96c7540 | [
"BSD-3-Clause"
] | 49 | 2018-08-27T07:52:25.000Z | 2022-02-08T13:54:05.000Z | python/GafferUI/UIEditor.py | hypothetical-inc/gaffer | 7da631400cfac5399255d23ff296f677e96c7540 | [
"BSD-3-Clause"
] | 21 | 2018-11-27T16:00:32.000Z | 2022-03-23T20:01:55.000Z | python/GafferUI/UIEditor.py | themissingcow/gaffer | b636debeb2c918fde55b3f4ef53fbc2e1e9ab78a | [
"BSD-3-Clause"
] | 4 | 2018-12-23T16:16:41.000Z | 2021-06-16T09:04:01.000Z | ##########################################################################
#
# Copyright (c) 2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | 33.675781 | 170 | 0.698013 | " plug empty so that it
# is available for use by the user on Reference nodes once a Box has
# been exported and referenced.
plugParent = self.__node
self.__plugAddButtons.setVisible( True )
self.__plugListing.setPlugParent( plugParent )
self.__sectionEditor.setPlugParent( plugParent )
for widg... | true | true |
f72a2f12d14736f1dea5052023ae58272f1954cd | 2,905 | py | Python | miniFawn/models.py | FelixTheC/allSales | 76d955b80bf9b5bb58bd53d8ee644249cf04e1a3 | [
"Apache-2.0"
] | null | null | null | miniFawn/models.py | FelixTheC/allSales | 76d955b80bf9b5bb58bd53d8ee644249cf04e1a3 | [
"Apache-2.0"
] | null | null | null | miniFawn/models.py | FelixTheC/allSales | 76d955b80bf9b5bb58bd53d8ee644249cf04e1a3 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.urls import reverse
from ordercontact.models import Ordercontactinvoiceaddresse
from ordercontact.models import Ordercontactdeliveryaddresse
from sales.models import ProductionRecordInputMiniGL
from sales.models import BaseModelWithoutBeltDesign
class Minifawnordermodel(BaseM... | 33.390805 | 100 | 0.703614 | from django.db import models
from django.urls import reverse
from ordercontact.models import Ordercontactinvoiceaddresse
from ordercontact.models import Ordercontactdeliveryaddresse
from sales.models import ProductionRecordInputMiniGL
from sales.models import BaseModelWithoutBeltDesign
class Minifawnordermodel(BaseM... | true | true |
f72a2fc7d90882bd0cd97ea02adabacff7fe8dea | 2,126 | py | Python | ml/myscript/Logisticegression.py | miraclestatus/mllearning | f5db6642e8c05488b133ee627e5f63c92e45ff6e | [
"Apache-2.0"
] | 1 | 2020-06-24T12:44:21.000Z | 2020-06-24T12:44:21.000Z | ml/myscript/Logisticegression.py | miraclestatus/mllearning | f5db6642e8c05488b133ee627e5f63c92e45ff6e | [
"Apache-2.0"
] | null | null | null | ml/myscript/Logisticegression.py | miraclestatus/mllearning | f5db6642e8c05488b133ee627e5f63c92e45ff6e | [
"Apache-2.0"
] | null | null | null | import numpy as np
from .metrics import accuracy_score
class Logisticegression():
def __init__(self):
# 系数
self.coef_ = None
# 截距
self.intercept_ = None
# 向量
self._theta = None
def _sigmoid(self, t):
return 1./(1. + np.exp(-t))
def fit(self, X_train, ... | 33.746032 | 84 | 0.562088 | import numpy as np
from .metrics import accuracy_score
class Logisticegression():
def __init__(self):
self.coef_ = None
self.intercept_ = None
self._theta = None
def _sigmoid(self, t):
return 1./(1. + np.exp(-t))
def fit(self, X_train, y_train, eta... | true | true |
f72a2ff159f35066264c6696680d05775e13ffd9 | 125,019 | py | Python | flare_emu.py | mr-tz/flare-emu | 0cc6b0b73feba3ffdd83e0892b18b9b4fcbe0403 | [
"Apache-2.0"
] | null | null | null | flare_emu.py | mr-tz/flare-emu | 0cc6b0b73feba3ffdd83e0892b18b9b4fcbe0403 | [
"Apache-2.0"
] | null | null | null | flare_emu.py | mr-tz/flare-emu | 0cc6b0b73feba3ffdd83e0892b18b9b4fcbe0403 | [
"Apache-2.0"
] | null | null | null | ############################################
# Copyright (C) 2018 FireEye, Inc.
#
# Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
# http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-BSD-3-CLAUSE or
# https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may... | 52.462862 | 138 | 0.562091 | ry read or write
# hookApis: set to False if you don't want flare-emu to emulate common
# instructions to emulate, Defaults to 0 (all code available).
def emulateRange(self, startAddr, endAddr=None, registers=None, stack=None, instructionHook=None, callHook=None,
... | true | true |
f72a30b3cc3869b03198bc2b6d011b858ede7e71 | 1,027 | py | Python | examples/rename_part.py | mradway/hycohanz | 717f1c84a8a6b555b4327b868aa5968a9a717a74 | [
"BSD-2-Clause"
] | 76 | 2015-07-13T19:56:25.000Z | 2022-03-29T08:53:56.000Z | examples/rename_part.py | zxzion/hycohanz | 717f1c84a8a6b555b4327b868aa5968a9a717a74 | [
"BSD-2-Clause"
] | 2 | 2016-09-12T14:13:17.000Z | 2020-03-23T17:57:30.000Z | examples/rename_part.py | zxzion/hycohanz | 717f1c84a8a6b555b4327b868aa5968a9a717a74 | [
"BSD-2-Clause"
] | 44 | 2015-01-10T12:43:37.000Z | 2022-03-27T14:13:00.000Z | import hycohanz as hfss
raw_input('Press "Enter" to connect to HFSS.>')
[oAnsoftApp, oDesktop] = hfss.setup_interface()
raw_input('Press "Enter" to create a new project.>')
oProject = hfss.new_project(oDesktop)
raw_input('Press "Enter" to insert a new DrivenModal design named HFSSDesign1.>')
oDesign = hfss.insert... | 23.340909 | 112 | 0.708861 | import hycohanz as hfss
raw_input('Press "Enter" to connect to HFSS.>')
[oAnsoftApp, oDesktop] = hfss.setup_interface()
raw_input('Press "Enter" to create a new project.>')
oProject = hfss.new_project(oDesktop)
raw_input('Press "Enter" to insert a new DrivenModal design named HFSSDesign1.>')
oDesign = hfss.insert... | true | true |
f72a3134f48e05427d75ca4ce77b2fb29d5b6bdf | 12,006 | py | Python | api_1.3/containerd/services/leases/v1/leases_pb2_grpc.py | siemens/pycontainerd | 9b1184ecbcc91144ad6903403818b5b8989a32f3 | [
"Apache-2.0"
] | 24 | 2019-12-16T12:38:51.000Z | 2022-02-16T18:44:20.000Z | api_1.5/containerd/services/leases/v1/leases_pb2_grpc.py | siemens/pycontainerd | 9b1184ecbcc91144ad6903403818b5b8989a32f3 | [
"Apache-2.0"
] | 9 | 2020-03-03T07:42:40.000Z | 2021-09-01T10:11:18.000Z | api_1.3/containerd/services/leases/v1/leases_pb2_grpc.py | siemens/pycontainerd | 9b1184ecbcc91144ad6903403818b5b8989a32f3 | [
"Apache-2.0"
] | 10 | 2019-12-16T11:20:23.000Z | 2022-01-24T01:53:13.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from containerd.services.leases.v1 import leases_pb2 as containerd_dot_services_dot_leases_dot_v1_dot_leases__pb2
from google.protobuf import empty_pb2 as google... | 48.804878 | 138 | 0.693487 |
import grpc
from containerd.services.leases.v1 import leases_pb2 as containerd_dot_services_dot_leases_dot_v1_dot_leases__pb2
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class LeasesStub(object):
def __init__(self, channel):
self.Create = channel.unary_unary(
... | true | true |
f72a323e448cb0a9fa157ef9d9d8c7e1cb25daf0 | 28,211 | py | Python | envbuilder.py | lurman/envbulder | 01dd05809e0a4558131bd6574186744364a08045 | [
"Apache-2.0"
] | null | null | null | envbuilder.py | lurman/envbulder | 01dd05809e0a4558131bd6574186744364a08045 | [
"Apache-2.0"
] | null | null | null | envbuilder.py | lurman/envbulder | 01dd05809e0a4558131bd6574186744364a08045 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import subprocess
from snc_config import SncConfig
from datetime import datetime, timedelta
import argparse
from argparse import RawTextHelpFormatter
from color_print import ColorPrint
from plugins import PluginsLoader
import os
from multiprocessing import Pool
import copy_reg
import types
from i... | 47.096828 | 157 | 0.618092 |
import subprocess
from snc_config import SncConfig
from datetime import datetime, timedelta
import argparse
from argparse import RawTextHelpFormatter
from color_print import ColorPrint
from plugins import PluginsLoader
import os
from multiprocessing import Pool
import copy_reg
import types
from itertools import repea... | true | true |
f72a3383995074634d5dafb504c727c501dbf175 | 3,484 | py | Python | tests/manage/rgw/test_bucket_deletion.py | prsurve/ocs-ci | a8e229755e1f9d43c8c71e5ba693cb14bfb38aed | [
"MIT"
] | null | null | null | tests/manage/rgw/test_bucket_deletion.py | prsurve/ocs-ci | a8e229755e1f9d43c8c71e5ba693cb14bfb38aed | [
"MIT"
] | null | null | null | tests/manage/rgw/test_bucket_deletion.py | prsurve/ocs-ci | a8e229755e1f9d43c8c71e5ba693cb14bfb38aed | [
"MIT"
] | null | null | null | import logging
import botocore
import pytest
from flaky import flaky
from ocs_ci.ocs.bucket_utils import retrieve_test_objects_to_pod, sync_object_directory
from ocs_ci.framework import config
from ocs_ci.framework.pytest_customization.marks import acceptance, tier1, tier3
from ocs_ci.ocs.exceptions import CommandFai... | 34.156863 | 98 | 0.581803 | import logging
import botocore
import pytest
from flaky import flaky
from ocs_ci.ocs.bucket_utils import retrieve_test_objects_to_pod, sync_object_directory
from ocs_ci.framework import config
from ocs_ci.framework.pytest_customization.marks import acceptance, tier1, tier3
from ocs_ci.ocs.exceptions import CommandFai... | true | true |
f72a33b918735569e106f2221c7a10a6e1392d92 | 1,864 | py | Python | tests/test_transforms_resize_modulo_pad_crop.py | civodlu/trw | b9a1cf045f61d6df9c65c014ef63b4048972dcdc | [
"MIT"
] | 3 | 2019-07-04T01:20:41.000Z | 2020-01-27T02:36:12.000Z | tests/test_transforms_resize_modulo_pad_crop.py | civodlu/trw | b9a1cf045f61d6df9c65c014ef63b4048972dcdc | [
"MIT"
] | null | null | null | tests/test_transforms_resize_modulo_pad_crop.py | civodlu/trw | b9a1cf045f61d6df9c65c014ef63b4048972dcdc | [
"MIT"
] | 2 | 2020-10-19T13:46:06.000Z | 2021-12-27T02:18:10.000Z | import unittest
import trw
import torch
import numpy as np
class TestTransformsResizeModuloPadCrop(unittest.TestCase):
def test_crop_mode_torch(self):
batch = {
'images': torch.rand([2, 3, 64, 64], dtype=torch.float32)
}
tfm = trw.transforms.TransformResizeModuloCropPad(60)
... | 34.518519 | 73 | 0.603541 | import unittest
import trw
import torch
import numpy as np
class TestTransformsResizeModuloPadCrop(unittest.TestCase):
def test_crop_mode_torch(self):
batch = {
'images': torch.rand([2, 3, 64, 64], dtype=torch.float32)
}
tfm = trw.transforms.TransformResizeModuloCropPad(60)
... | true | true |
f72a348b9cd34cfd35f617a68b5a5d79dd7ba065 | 1,758 | py | Python | biokit/services/coding_sequences/gc_content_second_position.py | JLSteenwyk/BioKIT | 9ca31d8003dc845bf56b2c56c87820c0b05021c4 | [
"MIT"
] | 8 | 2021-10-03T21:08:33.000Z | 2021-12-02T17:15:32.000Z | biokit/services/coding_sequences/gc_content_second_position.py | JLSteenwyk/BioKIT | 9ca31d8003dc845bf56b2c56c87820c0b05021c4 | [
"MIT"
] | null | null | null | biokit/services/coding_sequences/gc_content_second_position.py | JLSteenwyk/BioKIT | 9ca31d8003dc845bf56b2c56c87820c0b05021c4 | [
"MIT"
] | 5 | 2021-10-05T06:25:03.000Z | 2022-01-04T11:01:09.000Z | import re
from .base import CodingSequence
from ...helpers.files import read_and_parse_fasta_seqio
class GCContentSecondPosition(CodingSequence):
def __init__(self, args) -> None:
super().__init__(**self.process_args(args))
def run(self):
# create biopython object of sequences
record... | 32.555556 | 86 | 0.612628 | import re
from .base import CodingSequence
from ...helpers.files import read_and_parse_fasta_seqio
class GCContentSecondPosition(CodingSequence):
def __init__(self, args) -> None:
super().__init__(**self.process_args(args))
def run(self):
records = read_and_parse_fasta_seqio(self.fa... | true | true |
f72a34a439b3448174e70d31de729aeadbb9686e | 187 | py | Python | PCTC/2018 R2/Q5.py | object-oriented-human/competitive | 9e761020e887d8980a39a64eeaeaa39af0ecd777 | [
"MIT"
] | 1 | 2022-02-21T15:43:01.000Z | 2022-02-21T15:43:01.000Z | PCTC/2018 R2/Q5.py | foooop/competitive | 9e761020e887d8980a39a64eeaeaa39af0ecd777 | [
"MIT"
] | null | null | null | PCTC/2018 R2/Q5.py | foooop/competitive | 9e761020e887d8980a39a64eeaeaa39af0ecd777 | [
"MIT"
] | null | null | null | d = dict()
l = []
for i in range(int(input())):
x, y = input().split()
d[y] = x
l.append(y)
l.sort()
for i in range(len(l)):
if d[l[i]] == "Percy":
print(i+1)
break
| 13.357143 | 29 | 0.481283 | d = dict()
l = []
for i in range(int(input())):
x, y = input().split()
d[y] = x
l.append(y)
l.sort()
for i in range(len(l)):
if d[l[i]] == "Percy":
print(i+1)
break
| true | true |
f72a34a70be9391c0ff557e2faf72cca8765883e | 2,747 | py | Python | challenge.py | DaneliaSanchz/challenge-python-07 | 73b11936bf8fff81f99c271b2bf1c244706af207 | [
"MIT"
] | null | null | null | challenge.py | DaneliaSanchz/challenge-python-07 | 73b11936bf8fff81f99c271b2bf1c244706af207 | [
"MIT"
] | null | null | null | challenge.py | DaneliaSanchz/challenge-python-07 | 73b11936bf8fff81f99c271b2bf1c244706af207 | [
"MIT"
] | null | null | null | DATA = [
{
'name': 'Facundo',
'age': 72,
'organization': 'Platzi',
'position': 'Technical Mentor',
'language': 'python',
},
{
'name': 'Luisana',
'age': 33,
'organization': 'Globant',
'position': 'UX Designer',
'language': 'javas... | 21.801587 | 94 | 0.486713 | DATA = [
{
'name': 'Facundo',
'age': 72,
'organization': 'Platzi',
'position': 'Technical Mentor',
'language': 'python',
},
{
'name': 'Luisana',
'age': 33,
'organization': 'Globant',
'position': 'UX Designer',
'language': 'javas... | true | true |
f72a34fcaec6d61776028925ec6417f22ff909c9 | 30,977 | py | Python | flask/lib/python3.4/site-packages/babel/messages/catalog.py | ddayguerrero/blogme | e6ee6a47310c382648eefd96634630c3bceb864f | [
"MIT"
] | null | null | null | flask/lib/python3.4/site-packages/babel/messages/catalog.py | ddayguerrero/blogme | e6ee6a47310c382648eefd96634630c3bceb864f | [
"MIT"
] | null | null | null | flask/lib/python3.4/site-packages/babel/messages/catalog.py | ddayguerrero/blogme | e6ee6a47310c382648eefd96634630c3bceb864f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
babel.messages.catalog
~~~~~~~~~~~~~~~~~~~~~~
Data structures for message catalogs.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import re
import time
from cgi import parse_header
from datetime import datetime, time as time_... | 37.776829 | 80 | 0.569067 |
import re
import time
from cgi import parse_header
from datetime import datetime, time as time_
from difflib import get_close_matches
from email import message_from_string
from copy import copy
from babel import __version__ as VERSION
from babel.core import Locale
from babel.dates import format_datetime
from babel.... | true | true |
f72a350db1ba57a29e227da4a2688911fa9f59a9 | 1,600 | py | Python | app/api/db_config.py | gatemadavid/iReporter2 | 31ee2295a10c074bbf3b5b857240ec65ca9689e9 | [
"MIT"
] | null | null | null | app/api/db_config.py | gatemadavid/iReporter2 | 31ee2295a10c074bbf3b5b857240ec65ca9689e9 | [
"MIT"
] | null | null | null | app/api/db_config.py | gatemadavid/iReporter2 | 31ee2295a10c074bbf3b5b857240ec65ca9689e9 | [
"MIT"
] | null | null | null | import psycopg2
import psycopg2.extras
import os
url = os.getenv('DATABASE_URL')
def connection(url):
conn = psycopg2.connect(url)
return conn
def init_db():
con = connection(url)
return con
def create_tables():
conn = connection(url)
curr = conn.cursor()
queries = tables()
for qu... | 25.396825 | 67 | 0.636875 | import psycopg2
import psycopg2.extras
import os
url = os.getenv('DATABASE_URL')
def connection(url):
conn = psycopg2.connect(url)
return conn
def init_db():
con = connection(url)
return con
def create_tables():
conn = connection(url)
curr = conn.cursor()
queries = tables()
for qu... | true | true |
f72a355540cc984f158300eaacfdbb6e9b3587e6 | 2,682 | py | Python | apps/points/models.py | stasm/akupunktura | 5cf8b98dbb01a65db48c8f582f1592c680c47eba | [
"BSD-3-Clause"
] | 1 | 2015-05-14T19:10:29.000Z | 2015-05-14T19:10:29.000Z | apps/points/models.py | stasm/akupunktura | 5cf8b98dbb01a65db48c8f582f1592c680c47eba | [
"BSD-3-Clause"
] | null | null | null | apps/points/models.py | stasm/akupunktura | 5cf8b98dbb01a65db48c8f582f1592c680c47eba | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
class PointManager(models.Manager):
"""Manager for Pressure Points."""
def recently_added(self, count=10):
return self.order_by('-time_added')[:count]
class City(models.Model):
"""City the Press... | 30.827586 | 76 | 0.690902 | from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
class PointManager(models.Manager):
def recently_added(self, count=10):
return self.order_by('-time_added')[:count]
class City(models.Model):
name = models.CharField(max_length=200)
slug = model... | true | true |
f72a35b4e1de51ead743b2099fba5d0628b7e0b3 | 214 | py | Python | app/api.py | jecklgamis/flask-example-app | 025f60d812acae1eb33263de3339ac8e37096a54 | [
"Apache-2.0"
] | 6 | 2019-11-25T08:46:03.000Z | 2021-12-28T07:30:50.000Z | app/api.py | jecklgamis/flask-example-app | 025f60d812acae1eb33263de3339ac8e37096a54 | [
"Apache-2.0"
] | null | null | null | app/api.py | jecklgamis/flask-example-app | 025f60d812acae1eb33263de3339ac8e37096a54 | [
"Apache-2.0"
] | 1 | 2021-12-26T21:36:51.000Z | 2021-12-26T21:36:51.000Z | from flask import Blueprint
bp = Blueprint('api', __name__, url_prefix='/api')
from flask import jsonify
@bp.route('/', methods=['GET'])
def index():
return jsonify({"message": "This is the /api endpoint"})
| 21.4 | 60 | 0.682243 | from flask import Blueprint
bp = Blueprint('api', __name__, url_prefix='/api')
from flask import jsonify
@bp.route('/', methods=['GET'])
def index():
return jsonify({"message": "This is the /api endpoint"})
| true | true |
f72a37822a8c5d59218999e0dc281e80546e9c72 | 5,010 | py | Python | cmatch.py | kitneylab/cmatch | 6c804c2ca58f5e8ccde68c14182bebcb43ad69b4 | [
"MIT"
] | null | null | null | cmatch.py | kitneylab/cmatch | 6c804c2ca58f5e8ccde68c14182bebcb43ad69b4 | [
"MIT"
] | null | null | null | cmatch.py | kitneylab/cmatch | 6c804c2ca58f5e8ccde68c14182bebcb43ad69b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import json
import logging
import os
from os import path
from pathlib import Path
import time
from reconstruction import reconstruct
from futils import timeit
from tqdm import tqdm
from matching import Library, Sequence, match_library
import plac
# Logging configuration
current_file = path.b... | 26.368421 | 85 | 0.612774 |
import json
import logging
import os
from os import path
from pathlib import Path
import time
from reconstruction import reconstruct
from futils import timeit
from tqdm import tqdm
from matching import Library, Sequence, match_library
import plac
current_file = path.basename(__file__).split(".")[0]
@timeit
de... | true | true |
f72a37e5373aa4e623b73750d93d8aba42a35bcd | 929 | py | Python | jobs/pitch_deformer.py | nSimonFR/spoken_language_dataset | 07c018f28be72cec3ba5e9ec07608f79a6d32031 | [
"MIT"
] | 23 | 2018-06-25T10:22:57.000Z | 2021-07-09T09:53:47.000Z | jobs/pitch_deformer.py | nSimonFR/spoken_language_dataset | 07c018f28be72cec3ba5e9ec07608f79a6d32031 | [
"MIT"
] | 3 | 2018-07-19T18:47:07.000Z | 2021-06-01T22:11:53.000Z | jobs/pitch_deformer.py | nSimonFR/spoken_language_dataset | 07c018f28be72cec3ba5e9ec07608f79a6d32031 | [
"MIT"
] | 6 | 2018-07-14T17:48:51.000Z | 2020-12-24T01:31:41.000Z | from . import common
from audio_toolbox import sox
class PitchDeformer:
SUFFIX = '.pitch@n'
def __init__(self, input_files_key, output_files_key, semitones):
self.input_files_key = input_files_key
self.output_files_key = output_files_key
self.semitones = semitones
def execute(sel... | 33.178571 | 76 | 0.665231 | from . import common
from audio_toolbox import sox
class PitchDeformer:
SUFFIX = '.pitch@n'
def __init__(self, input_files_key, output_files_key, semitones):
self.input_files_key = input_files_key
self.output_files_key = output_files_key
self.semitones = semitones
def execute(sel... | true | true |
f72a37ebb93db977a1a827e2699a50ef563720f7 | 4,654 | py | Python | app/user/tests/test_user_api.py | gmarshall142/appservices | 2dae37dfe6693a3f61f3561cabfaff78ad7616e4 | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | gmarshall142/appservices | 2dae37dfe6693a3f61f3561cabfaff78ad7616e4 | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | gmarshall142/appservices | 2dae37dfe6693a3f61f3561cabfaff78ad7616e4 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse('user:create')
TOKEN_URL = reverse('user:token')
ME_URL = reverse('user:me')
def create_user(**params)... | 37.232 | 77 | 0.662226 | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse('user:create')
TOKEN_URL = reverse('user:token')
ME_URL = reverse('user:me')
def create_user(**params)... | true | true |
f72a38772dfca7924eadc81291de0091589ed69c | 1,788 | py | Python | samples/generated_samples/aiplatform_generated_aiplatform_v1_job_service_delete_hyperparameter_tuning_job_async.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 180 | 2020-09-23T17:21:15.000Z | 2022-03-30T17:25:47.000Z | samples/generated_samples/aiplatform_generated_aiplatform_v1_job_service_delete_hyperparameter_tuning_job_async.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 601 | 2020-09-23T16:23:44.000Z | 2022-03-31T19:08:23.000Z | samples/generated_samples/aiplatform_generated_aiplatform_v1_job_service_delete_hyperparameter_tuning_job_async.py | lclc19/python-aiplatform | d8da2e365277441abadb04328943f23345d72b0e | [
"Apache-2.0"
] | 109 | 2020-09-23T16:22:04.000Z | 2022-03-28T21:18:29.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.76 | 108 | 0.779083 |
from google.cloud import aiplatform_v1
async def sample_delete_hyperparameter_tuning_job():
client = aiplatform_v1.JobServiceAsyncClient()
request = aiplatform_v1.DeleteHyperparameterTuningJobRequest(
name="projects/{project}/locations/{location}/hyperparameterTun... | true | true |
f72a38aef278e33aedce4abdf04469c32de8d0bd | 1,510 | py | Python | minecraft/config.py | leosumi/Minecraft | 4215bf0fe0b0e2fd386b1990a4589afc239879a7 | [
"MIT"
] | null | null | null | minecraft/config.py | leosumi/Minecraft | 4215bf0fe0b0e2fd386b1990a4589afc239879a7 | [
"MIT"
] | null | null | null | minecraft/config.py | leosumi/Minecraft | 4215bf0fe0b0e2fd386b1990a4589afc239879a7 | [
"MIT"
] | null | null | null | import math
import configparser
from util import tex_coords
CONFIG_PATH = "config.ini"
config = configparser.ConfigParser()
config.read(CONFIG_PATH)
WIDTH = config.getint("window", "width")
HEIGHT = config.getint("window", "height")
CAPTION = config["window"]["caption"]
TICKS_PER_SEC = config.getint("game", "ticks_... | 29.038462 | 93 | 0.662252 | import math
import configparser
from util import tex_coords
CONFIG_PATH = "config.ini"
config = configparser.ConfigParser()
config.read(CONFIG_PATH)
WIDTH = config.getint("window", "width")
HEIGHT = config.getint("window", "height")
CAPTION = config["window"]["caption"]
TICKS_PER_SEC = config.getint("game", "ticks_... | true | true |
f72a39b2dc13c27df0c09468e6d52f23ae747f9d | 10,696 | py | Python | packages/amplify-graphql-searchable-transformer/streaming-lambda/python_streaming_function.py | jcbdev/amplify-cli | 08f7a3c45b2e98535ef325eb0a97c5bc4d3008c6 | [
"Apache-2.0",
"MIT"
] | null | null | null | packages/amplify-graphql-searchable-transformer/streaming-lambda/python_streaming_function.py | jcbdev/amplify-cli | 08f7a3c45b2e98535ef325eb0a97c5bc4d3008c6 | [
"Apache-2.0",
"MIT"
] | null | null | null | packages/amplify-graphql-searchable-transformer/streaming-lambda/python_streaming_function.py | jcbdev/amplify-cli | 08f7a3c45b2e98535ef325eb0a97c5bc4d3008c6 | [
"Apache-2.0",
"MIT"
] | null | null | null | import base64
import json
import logging
import os
import time
import traceback
from urllib.parse import urlparse, quote
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest
from botocore.credentials import get_credentials
from botocore.endpoint import BotocoreHTTPSession
from botocore.sessio... | 41.457364 | 122 | 0.63089 | import base64
import json
import logging
import os
import time
import traceback
from urllib.parse import urlparse, quote
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest
from botocore.credentials import get_credentials
from botocore.endpoint import BotocoreHTTPSession
from botocore.sessio... | true | true |
f72a3a7ba2336005b049f9e3a57c4f4b44ad48b8 | 47 | py | Python | docs/test-dataset/code/some-code.py | slugb0t/SODA-for-SPARC | f2dd5f5817984ca0a500dd628f8055a6a0d1ff48 | [
"MIT"
] | 16 | 2019-11-19T02:19:16.000Z | 2022-01-09T04:51:50.000Z | docs/test-dataset/code/some-code.py | slugb0t/SODA-for-SPARC | f2dd5f5817984ca0a500dd628f8055a6a0d1ff48 | [
"MIT"
] | 6 | 2020-06-17T19:37:08.000Z | 2021-08-03T21:01:25.000Z | docs/test-dataset/code/some-code.py | slugb0t/SODA-for-SPARC | f2dd5f5817984ca0a500dd628f8055a6a0d1ff48 | [
"MIT"
] | 7 | 2019-11-08T20:45:32.000Z | 2021-09-15T22:45:18.000Z | print('Hello! This is an example python file.') | 47 | 47 | 0.744681 | print('Hello! This is an example python file.') | true | true |
f72a3bfc43a32b945e3678a36f687019936e886c | 2,966 | py | Python | nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py | nicholsn/nipype | 6601b00aac39d17bb9fb3a6801f5a740a6ebb1e3 | [
"BSD-3-Clause"
] | 1 | 2018-04-18T12:13:37.000Z | 2018-04-18T12:13:37.000Z | nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/freesurfer/tests/test_auto_SurfaceSnapshots.py | ito-takuya/nipype | 9099a5809487b55868cdec82a719030419cbd6ba | [
"BSD-3-Clause"
] | 1 | 2021-09-08T14:31:47.000Z | 2021-09-08T14:31:47.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.freesurfer.utils import SurfaceSnapshots
def test_SurfaceSnapshots_inputs():
input_map = dict(annot_file=dict(argstr='-annotation %s',
xor=['annot_name'],
),
annot_name=dict(argstr='-ann... | 26.720721 | 78 | 0.631827 |
from nipype.testing import assert_equal
from nipype.interfaces.freesurfer.utils import SurfaceSnapshots
def test_SurfaceSnapshots_inputs():
input_map = dict(annot_file=dict(argstr='-annotation %s',
xor=['annot_name'],
),
annot_name=dict(argstr='-annotation %s',
xor=['annot_file'],
),
args=... | true | true |
f72a3c91953b5858fea12c86441ca8a3375897bc | 420 | py | Python | examples/quantum/hydrogen.py | olivierverdier/sfepy | 83aefb7b33ea17f4acb83388ba8bc7314c77616c | [
"BSD-3-Clause"
] | 1 | 2015-07-30T13:47:23.000Z | 2015-07-30T13:47:23.000Z | examples/quantum/hydrogen.py | olivierverdier/sfepy | 83aefb7b33ea17f4acb83388ba8bc7314c77616c | [
"BSD-3-Clause"
] | null | null | null | examples/quantum/hydrogen.py | olivierverdier/sfepy | 83aefb7b33ea17f4acb83388ba8bc7314c77616c | [
"BSD-3-Clause"
] | null | null | null | from sfepy.linalg import norm_l2_along_axis
from quantum_common import common
def fun_v(ts, coor, mode=None, region=None, ig=None):
from numpy import sqrt
if not mode == 'qp': return
out = {}
C = 0.5
r = norm_l2_along_axis(coor, axis=1)
V = - C * 1.0 / r
V.shape = (V.shape[0], 1, 1)
... | 18.26087 | 53 | 0.597619 | from sfepy.linalg import norm_l2_along_axis
from quantum_common import common
def fun_v(ts, coor, mode=None, region=None, ig=None):
from numpy import sqrt
if not mode == 'qp': return
out = {}
C = 0.5
r = norm_l2_along_axis(coor, axis=1)
V = - C * 1.0 / r
V.shape = (V.shape[0], 1, 1)
... | true | true |
f72a3ca047444fe42cfb054b4d7ce31ac8ea8792 | 322 | py | Python | djthia/dashboard/urls.py | carthage-college/django-djthia | a10026b305aa75e20d2ea8c5d3e7ad03c05f10f5 | [
"MIT"
] | null | null | null | djthia/dashboard/urls.py | carthage-college/django-djthia | a10026b305aa75e20d2ea8c5d3e7ad03c05f10f5 | [
"MIT"
] | 9 | 2020-08-02T13:58:23.000Z | 2022-02-15T15:30:58.000Z | djthia/dashboard/urls.py | carthage-college/django-djthia | a10026b305aa75e20d2ea8c5d3e7ad03c05f10f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""URLs for all views."""
from django.urls import path
from djthia.dashboard import views
urlpatterns = [
path('<str:oid>/detail/', views.detail, name='gearup_detail'),
path('search/', views.search, name='gearup_search'),
path('', views.home, name='dashboard_home'),
]... | 23 | 67 | 0.630435 |
from django.urls import path
from djthia.dashboard import views
urlpatterns = [
path('<str:oid>/detail/', views.detail, name='gearup_detail'),
path('search/', views.search, name='gearup_search'),
path('', views.home, name='dashboard_home'),
]
| true | true |
f72a3ce19ca0b74533a7945aaed6c0b03ba83aa2 | 33,034 | py | Python | optuna/storages/rdb/storage.py | scouvreur/optuna | 41716fe394aca87e5dce465443ac72ed53891a44 | [
"MIT"
] | null | null | null | optuna/storages/rdb/storage.py | scouvreur/optuna | 41716fe394aca87e5dce465443ac72ed53891a44 | [
"MIT"
] | null | null | null | optuna/storages/rdb/storage.py | scouvreur/optuna | 41716fe394aca87e5dce465443ac72ed53891a44 | [
"MIT"
] | null | null | null | import alembic.command
import alembic.config
import alembic.migration
import alembic.script
from collections import defaultdict
import copy
from datetime import datetime
import json
import logging
import os
import six
from sqlalchemy.engine import create_engine
from sqlalchemy.engine import Engine # NOQA
from sqlalche... | 36.62306 | 99 | 0.647908 | import alembic.command
import alembic.config
import alembic.migration
import alembic.script
from collections import defaultdict
import copy
from datetime import datetime
import json
import logging
import os
import six
from sqlalchemy.engine import create_engine
from sqlalchemy.engine import Engine
from sqlalchemy.exc... | true | true |
f72a3dab5f6feb060e408b3588fb869452950336 | 1,352 | py | Python | src/main.py | dex73r/ghdown | b1e72b95e10d8d7d2d41cb4e8558cb29c018ac81 | [
"MIT"
] | null | null | null | src/main.py | dex73r/ghdown | b1e72b95e10d8d7d2d41cb4e8558cb29c018ac81 | [
"MIT"
] | null | null | null | src/main.py | dex73r/ghdown | b1e72b95e10d8d7d2d41cb4e8558cb29c018ac81 | [
"MIT"
] | null | null | null | import argparse
import os
import requests
from git import Repo
def main():
parser = argparse.ArgumentParser(description="A tool to clone github only repositories of user or group")
parser.add_argument("--u", help="target of massive download",
dest='target', required=True)
parser.ad... | 30.727273 | 109 | 0.572485 | import argparse
import os
import requests
from git import Repo
def main():
parser = argparse.ArgumentParser(description="A tool to clone github only repositories of user or group")
parser.add_argument("--u", help="target of massive download",
dest='target', required=True)
parser.ad... | true | true |
f72a3ef23ff298d116c3a38c8d217d46311ba4f3 | 789 | py | Python | socialcops/api/config.py | yutiansut/Long-Running-Jobs-Manager | ed12bebb7872b95e1f65548be4a00715f2ad47a6 | [
"MIT"
] | 1 | 2019-09-15T19:52:10.000Z | 2019-09-15T19:52:10.000Z | socialcops/api/config.py | yutiansut/Long-Running-Jobs-Manager | ed12bebb7872b95e1f65548be4a00715f2ad47a6 | [
"MIT"
] | null | null | null | socialcops/api/config.py | yutiansut/Long-Running-Jobs-Manager | ed12bebb7872b95e1f65548be4a00715f2ad47a6 | [
"MIT"
] | 1 | 2019-09-15T19:53:04.000Z | 2019-09-15T19:53:04.000Z | import os
basedir = os.path.abspath(os.path.dirname(__file__))
# Keeping track of various configurations of the Flask app
class Config(object):
ALLOWED_EXTENSIONS = set(['csv'])
UPLOAD_FOLDER = './files/uploads/'
DOWNLOAD_FOLDER = './files/downloads/'
SECRET_KEY = os.environ.get('SECRET_KEY') or \
... | 41.526316 | 72 | 0.695817 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
ALLOWED_EXTENSIONS = set(['csv'])
UPLOAD_FOLDER = './files/uploads/'
DOWNLOAD_FOLDER = './files/downloads/'
SECRET_KEY = os.environ.get('SECRET_KEY') or \
'uUHQMFSPB9H7G4bGwzFLDetrIyb4M8tj'
SQLALCHEMY_DATA... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.