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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2beb17305d8936ca8116de0afa4ec98fd39c51 | 127 | py | Python | language/_experimental/peace/_coherent.py | jedhsu/language | 3772a4a0ff287e1fc5ebefc716b8d91928d04c72 | [
"MIT"
] | null | null | null | language/_experimental/peace/_coherent.py | jedhsu/language | 3772a4a0ff287e1fc5ebefc716b8d91928d04c72 | [
"MIT"
] | null | null | null | language/_experimental/peace/_coherent.py | jedhsu/language | 3772a4a0ff287e1fc5ebefc716b8d91928d04c72 | [
"MIT"
] | null | null | null | """
*Coherent*
"""
from abc import ABCMeta
__all__ = [
"Coherent",
]
class Coherent:
__metaclass__ = ABCMeta
| 7.9375 | 27 | 0.598425 |
from abc import ABCMeta
__all__ = [
"Coherent",
]
class Coherent:
__metaclass__ = ABCMeta
| true | true |
1c2becd673e4d1caa9ff0dcb3a8856e5946e4172 | 1,185 | py | Python | zerver/migrations/0232_make_archive_transaction_field_not_nullable.py | kaustubh-nair/zulip | fb96407607c1f42b350980ad13af20b884750606 | [
"Apache-2.0"
] | 6 | 2019-05-09T20:43:20.000Z | 2022-03-29T05:53:50.000Z | zerver/migrations/0232_make_archive_transaction_field_not_nullable.py | kaustubh-nair/zulip | fb96407607c1f42b350980ad13af20b884750606 | [
"Apache-2.0"
] | 2 | 2016-10-18T04:01:56.000Z | 2016-10-20T18:19:09.000Z | zerver/migrations/0232_make_archive_transaction_field_not_nullable.py | kaustubh-nair/zulip | fb96407607c1f42b350980ad13af20b884750606 | [
"Apache-2.0"
] | 7 | 2016-08-10T02:24:32.000Z | 2022-03-28T15:14:18.000Z | import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
"""
Tables cannot have data deleted from them and be altered in a single transaction,
but we need the DELETEs to be atomic together. So we set atomic=False for the migration
in general, and... | 33.857143 | 113 | 0.683544 | import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
atomic = False
dependencies = [
('zerver', '0231_add_archive_transaction_model'),
]
operations = [
migrations.RunSQL("""
BEGIN;
DELETE FROM zerver_archived... | true | true |
1c2bed449e2331f0a0e96bda18a70f2e92511a9b | 36,224 | py | Python | pydantic/schema.py | xzycn/pydantic | 36c0af787fee01fe566a38c9a3d19940cb3e93c8 | [
"MIT"
] | 1 | 2020-03-03T22:12:12.000Z | 2020-03-03T22:12:12.000Z | pydantic/schema.py | xzycn/pydantic | 36c0af787fee01fe566a38c9a3d19940cb3e93c8 | [
"MIT"
] | 5 | 2021-06-02T03:55:08.000Z | 2022-03-12T00:54:02.000Z | pydantic/schema.py | xzycn/pydantic | 36c0af787fee01fe566a38c9a3d19940cb3e93c8 | [
"MIT"
] | 1 | 2021-10-05T16:57:32.000Z | 2021-10-05T16:57:32.000Z | import re
import warnings
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from enum import Enum
from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
Callable,
... | 40.838782 | 120 | 0.665443 | import re
import warnings
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from enum import Enum
from ipaddress import IPv4Address, IPv4Interface, IPv4Network, IPv6Address, IPv6Interface, IPv6Network
from pathlib import Path
from typing import (
TYPE_CHECKING,
Any,
Callable,
... | true | true |
1c2bed8c36105c3c4609fb84bceed7998b51d8e0 | 2,945 | py | Python | cinder/tests/api/contrib/test_availability_zones.py | cloudbau/cinder | 3179f2f42ae940a08b910e326a809556689864d8 | [
"Apache-2.0"
] | 1 | 2015-11-25T10:18:28.000Z | 2015-11-25T10:18:28.000Z | cinder/tests/api/contrib/test_availability_zones.py | NeCTAR-RC/cinder | e01da23febc530de218ed8eed6737add150c1587 | [
"Apache-2.0"
] | null | null | null | cinder/tests/api/contrib/test_availability_zones.py | NeCTAR-RC/cinder | e01da23febc530de218ed8eed6737add150c1587 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 OpenStack Foundation
# 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 ... | 32.362637 | 78 | 0.639728 |
import datetime
from lxml import etree
import cinder.api.contrib.availability_zones
import cinder.context
from cinder.openstack.common import timeutils
import cinder.test
import cinder.volume.api
created_time = datetime.datetime(2012, 11, 14, 1, 20, 41, 95099)
current_time = timeutils.utcnow()
def list_availabil... | true | true |
1c2bed98a4878cd82b3abdfca2bc12690e5daeec | 910 | py | Python | modulo 2/d068/par_impar_v2.py | rafa-evangelista/PYTHON | 761ec7e01f1617263bc023a6b82b599a936275ee | [
"MIT"
] | null | null | null | modulo 2/d068/par_impar_v2.py | rafa-evangelista/PYTHON | 761ec7e01f1617263bc023a6b82b599a936275ee | [
"MIT"
] | null | null | null | modulo 2/d068/par_impar_v2.py | rafa-evangelista/PYTHON | 761ec7e01f1617263bc023a6b82b599a936275ee | [
"MIT"
] | null | null | null | from random import randint
print('.'*35)
print('PAR OU ÍMPAR')
print('.'*35)
soma = 0
while True:
minha_escolha = ''
while minha_escolha not in 'PI':
minha_escolha = str(
input('Você escolhe PAR ou ÍMPAR [P] ou [I]? ')).strip().upper()[0]
if minha_escolha == 'P':
escolha_computa... | 29.354839 | 98 | 0.562637 | from random import randint
print('.'*35)
print('PAR OU ÍMPAR')
print('.'*35)
soma = 0
while True:
minha_escolha = ''
while minha_escolha not in 'PI':
minha_escolha = str(
input('Você escolhe PAR ou ÍMPAR [P] ou [I]? ')).strip().upper()[0]
if minha_escolha == 'P':
escolha_computa... | true | true |
1c2bee4abdea0305d9da67ec0e87f6ee51bf00a1 | 19,713 | py | Python | src/vnsw/opencontrail-vrouter-netns/opencontrail_vrouter_netns/vrouter_netns.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | null | null | null | src/vnsw/opencontrail-vrouter-netns/opencontrail_vrouter_netns/vrouter_netns.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | null | null | null | src/vnsw/opencontrail-vrouter-netns/opencontrail_vrouter_netns/vrouter_netns.py | biswajit-mandal/contrail-controller | 80c4a7e8515f7296b18ba4c21a439bd3daefcc4a | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2014 Cloudwatt
# 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/l... | 38.805118 | 85 | 0.566022 |
from __future__ import print_function
__docformat__ = "restructuredtext en"
import argparse
import netaddr
import sys
import uuid
import subprocess
import requests
import json
import os
import shlex
from linux import ip_lib
import haproxy_process
def validate_uuid(val):
try:
if str(uuid.UUID(val)) ==... | true | true |
1c2bee4bac7fec0321a50314dc6ae2c0c1cf7725 | 428 | py | Python | Informatik1/Midterms Prep/midterms hs19/find_sum.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | 8 | 2021-11-21T10:02:08.000Z | 2022-03-15T21:02:02.000Z | Informatik1/Midterms Prep/midterms hs19/find_sum.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | null | null | null | Informatik1/Midterms Prep/midterms hs19/find_sum.py | Queentaker/uzh | 35cccaf910b95d15db21be80c8567eb427202591 | [
"MIT"
] | 3 | 2021-11-19T18:52:56.000Z | 2022-02-27T15:45:59.000Z | def find_sum(list, target):
for idx1, v1 in enumerate(list):
for idx2, v2 in enumerate(list):
if idx1 == idx2:
continue
if v1 + v2 == target:
return(idx1, idx2)
return None
print(find_sum([], 9)) #None
print(find_sum([1], 2)) #None
print(fin... | 26.75 | 41 | 0.511682 | def find_sum(list, target):
for idx1, v1 in enumerate(list):
for idx2, v2 in enumerate(list):
if idx1 == idx2:
continue
if v1 + v2 == target:
return(idx1, idx2)
return None
print(find_sum([], 9)) print(find_sum([1], 2)) print(find_sum([1, 1]... | true | true |
1c2beef66162473376677f0874951e423d99c133 | 5,824 | py | Python | tests/integration_tests/dashboards/filter_state/api_tests.py | mabossert/superset | d9e9c3a3de2ec5fe90c613ac06ad2a5606c43ece | [
"Apache-2.0"
] | 1 | 2021-12-02T03:47:56.000Z | 2021-12-02T03:47:56.000Z | tests/integration_tests/dashboards/filter_state/api_tests.py | mabossert/superset | d9e9c3a3de2ec5fe90c613ac06ad2a5606c43ece | [
"Apache-2.0"
] | 11 | 2021-12-04T14:16:33.000Z | 2022-02-21T16:07:30.000Z | tests/integration_tests/dashboards/filter_state/api_tests.py | bretton7700/alertsAndReports | d3feca6973baa9a265805a095464650e6af7b0d9 | [
"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... | 36.860759 | 85 | 0.684753 | import json
from typing import Any
from unittest.mock import patch
import pytest
from flask.testing import FlaskClient
from sqlalchemy.orm import Session
from superset import app
from superset.dashboards.commands.exceptions import DashboardAccessDeniedError
from superset.extensions import cache_manager
from superset.... | true | true |
1c2bef230bc14bd35ef8b0f84b1a984e28b66c66 | 4,900 | py | Python | sympy/plotting/textplot.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/plotting/textplot.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | sympy/plotting/textplot.py | msgoff/sympy | 1e7daef7514902f5e89718fa957b7b36c6669a10 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division
from sympy.core.numbers import Float
from sympy.core.symbol import Dummy
from sympy.utilities.lambdify import lambdify
import math
def is_valid(x):
"""Check if a floating point number is valid"""
if x is None:
return False
if isinstance(x, complex)... | 31.210191 | 87 | 0.380204 | from __future__ import print_function, division
from sympy.core.numbers import Float
from sympy.core.symbol import Dummy
from sympy.utilities.lambdify import lambdify
import math
def is_valid(x):
if x is None:
return False
if isinstance(x, complex):
return False
return not math.isinf(x) ... | true | true |
1c2bf09b1133e9b2ad9fd1508d657f6294cf8cfb | 2,758 | py | Python | catalog/bindings/gmd/arc_by_center_point_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/arc_by_center_point_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/arc_by_center_point_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass, field
from typing import Optional
from bindings.gmd.abstract_curve_segment_type import AbstractCurveSegmentType
from bindings.gmd.angle_type import AngleType
from bindings.gmd.coordinates import Coordinates
from bindings.gmd.curve_interpolation_type import CurveInterpolationType
from ... | 28.729167 | 77 | 0.568891 | from dataclasses import dataclass, field
from typing import Optional
from bindings.gmd.abstract_curve_segment_type import AbstractCurveSegmentType
from bindings.gmd.angle_type import AngleType
from bindings.gmd.coordinates import Coordinates
from bindings.gmd.curve_interpolation_type import CurveInterpolationType
from ... | true | true |
1c2bf125fa33e0f79dc94f4ba4b890f6c187bae6 | 2,260 | py | Python | tests/models/v2/average_analysed_drive_stats_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | tests/models/v2/average_analysed_drive_stats_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | tests/models/v2/average_analysed_drive_stats_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | #!/usr/bin/env python
# coding: utf-8
"""
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions... | 59.473684 | 845 | 0.781416 |
import unittest
from netapp.santricity.models.v2.average_analysed_drive_stats import AverageAnalysedDriveStats
class AverageAnalysedDriveStatsTest(unittest.TestCase):
def test_average_analysed_drive_stats(self):
average_analysed_drive_stats_obj = AverageAnalysedDriveStats()
... | true | true |
1c2bf165335c159012d35da21c1793b566b09b91 | 578 | py | Python | nevow/test/test_tabbedpane.py | wthie/nevow | e630de8f640f27df85c38bc37ecdaf4e7b931afc | [
"MIT"
] | 49 | 2015-03-18T15:29:16.000Z | 2021-11-17T12:30:51.000Z | src/nevow/test/test_tabbedpane.py | winjer/squeal | 20401986e0d1698776f5b482b28e14c57b11833c | [
"Apache-2.0"
] | 62 | 2015-01-21T08:48:08.000Z | 2021-04-02T17:31:29.000Z | src/nevow/test/test_tabbedpane.py | winjer/squeal | 20401986e0d1698776f5b482b28e14c57b11833c | [
"Apache-2.0"
] | 30 | 2015-02-26T09:35:39.000Z | 2021-07-24T12:45:04.000Z | # Copyright (c) 2009 Divmod. See LICENSE for details.
"""
Tests for L{nevow.taglibrary.tabbedPane}.
"""
from twisted.trial.unittest import TestCase
class TabbedPaneTests(TestCase):
def test_import(self):
"""
L{nevow.taglibrary.tabbedPane} can be imported.
This is a very meager test, an... | 27.52381 | 72 | 0.681661 |
from twisted.trial.unittest import TestCase
class TabbedPaneTests(TestCase):
def test_import(self):
import nevow.taglibrary.tabbedPane
| true | true |
1c2bf40f9814a7452866b58655c468474e01efdb | 1,093 | py | Python | setup.py | 5long/forwardable | 30d0f1989265acf05b0302abbf307d887f40ab05 | [
"MIT"
] | 31 | 2015-01-20T15:08:22.000Z | 2020-11-24T20:52:58.000Z | setup.py | 5long/forwardable | 30d0f1989265acf05b0302abbf307d887f40ab05 | [
"MIT"
] | 2 | 2019-05-13T06:27:45.000Z | 2019-08-15T06:10:36.000Z | setup.py | 5long/forwardable | 30d0f1989265acf05b0302abbf307d887f40ab05 | [
"MIT"
] | 6 | 2019-05-09T09:35:06.000Z | 2021-08-16T09:01:56.000Z | #!/usr/bin/env python
from setuptools import setup
from forwardable import __version__
setup(
name='forwardable',
version=__version__,
description="Forwardable as in Ruby's stdlib",
url='https://github.com/5long/forwardable',
long_description=open("README.rst").read(),
author="Whyme Lyu",
... | 30.361111 | 66 | 0.619396 |
from setuptools import setup
from forwardable import __version__
setup(
name='forwardable',
version=__version__,
description="Forwardable as in Ruby's stdlib",
url='https://github.com/5long/forwardable',
long_description=open("README.rst").read(),
author="Whyme Lyu",
author_email="callme5... | true | true |
1c2bf5c725262d5b1f8d86c19cab70d1597efa3a | 563 | gyp | Python | binding.gyp | GaikwadPratik/node-linux-pam | 9249114b2efb3b1ff86b8ee2d7c12c8605faaa23 | [
"MIT"
] | null | null | null | binding.gyp | GaikwadPratik/node-linux-pam | 9249114b2efb3b1ff86b8ee2d7c12c8605faaa23 | [
"MIT"
] | null | null | null | binding.gyp | GaikwadPratik/node-linux-pam | 9249114b2efb3b1ff86b8ee2d7c12c8605faaa23 | [
"MIT"
] | null | null | null | {
"targets": [
{
"target_name": "node-linux-pam",
"cflags!": ["-fno-exceptions"],
"cflags_cc!": ["-fno-exceptions"],
"sources": [
"src/index.cc",
"src/pam_worker.cpp"
],
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'GCC_ENABL... | 21.653846 | 60 | 0.445826 | {
"targets": [
{
"target_name": "node-linux-pam",
"cflags!": ["-fno-exceptions"],
"cflags_cc!": ["-fno-exceptions"],
"sources": [
"src/index.cc",
"src/pam_worker.cpp"
],
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'GCC_ENABL... | true | true |
1c2bf6a63fa7b00998e842355efee74c370d0689 | 3,447 | py | Python | pymisp/tools/vehicleobject.py | kak-bo-che/PyMISP | 23d732e398471ade1d28c7ec1e61977329df07ea | [
"BSD-2-Clause"
] | null | null | null | pymisp/tools/vehicleobject.py | kak-bo-che/PyMISP | 23d732e398471ade1d28c7ec1e61977329df07ea | [
"BSD-2-Clause"
] | null | null | null | pymisp/tools/vehicleobject.py | kak-bo-che/PyMISP | 23d732e398471ade1d28c7ec1e61977329df07ea | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python3
import requests
import json
from .abstractgenerator import AbstractMISPObjectGenerator
# Original sourcecode: https://github.com/hayk57/MISP_registration_check
class VehicleObject(AbstractMISPObjectGenerator):
'''Vehicle object generator out of regcheck.org.uk'''
country_urls = {
... | 42.036585 | 112 | 0.653612 |
import requests
import json
from .abstractgenerator import AbstractMISPObjectGenerator
class VehicleObject(AbstractMISPObjectGenerator):
country_urls = {
'fr': "http://www.regcheck.org.uk/api/reg.asmx/CheckFrance",
'es': "http://www.regcheck.org.uk/api/reg.asmx/CheckSpain",
'uk': "http... | true | true |
1c2bf8b07e26a0bf34dc5b1b7d2d271c2ab8488a | 2,433 | py | Python | huaweicloud-sdk-vpcep/huaweicloudsdkvpcep/v1/model/delete_endpoint_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-vpcep/huaweicloudsdkvpcep/v1/model/delete_endpoint_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-vpcep/huaweicloudsdkvpcep/v1/model/delete_endpoint_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteEndpointResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 28.290698 | 79 | 0.55076 |
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteEndpointResponse(SdkResponse):
sensitive_list = []
openapi_types = {
}
attribute_map = {
}
def __init__(self):
... | true | true |
1c2bfc2d2277fd98cef9390d253e1790f4aebd3f | 153 | py | Python | src/fake-email/ruks.py | AboFatma512/fake-email | d9bf3c3001a36126d34671f78bf7ed77ded7701a | [
"MIT"
] | 14 | 2021-10-31T20:39:40.000Z | 2022-01-03T15:32:42.000Z | src/fake-email/ruks.py | AboFatma512/fake-email | d9bf3c3001a36126d34671f78bf7ed77ded7701a | [
"MIT"
] | null | null | null | src/fake-email/ruks.py | AboFatma512/fake-email | d9bf3c3001a36126d34671f78bf7ed77ded7701a | [
"MIT"
] | 4 | 2021-11-01T11:42:45.000Z | 2022-01-26T14:33:59.000Z | URL = "https://10minutemail.com"
EMAIL = URL + "/session/address"
MESSAGE_A = URL + "/messages/messagesAfter/"
MESSAGE_C = URL + "/messages/messageCount" | 38.25 | 44 | 0.718954 | URL = "https://10minutemail.com"
EMAIL = URL + "/session/address"
MESSAGE_A = URL + "/messages/messagesAfter/"
MESSAGE_C = URL + "/messages/messageCount" | true | true |
1c2bfd3d9326aa478d6c1164c854527ce75f53b5 | 5,148 | py | Python | standup_and_prosper_sdk/models/thread.py | Teaminator/standup-and-prosper-sdk.py | ccdba4a24f395dc0b45d9f9da9bdf5038e1b1617 | [
"Apache-2.0"
] | 1 | 2021-09-16T08:02:35.000Z | 2021-09-16T08:02:35.000Z | standup_and_prosper_sdk/models/thread.py | Teaminator/standup-and-prosper-sdk.py | ccdba4a24f395dc0b45d9f9da9bdf5038e1b1617 | [
"Apache-2.0"
] | 1 | 2021-06-14T16:45:56.000Z | 2021-06-14T16:56:05.000Z | standup_and_prosper_sdk/models/thread.py | Teaminator/standup-and-prosper-sdk.py | ccdba4a24f395dc0b45d9f9da9bdf5038e1b1617 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class Thread(object):
"""
Attributes:
swagger_types (dict): The key is attribute name and the value is attribute type.
attribute_map (dict): The key is attribute name and the value is json key in definition.
"""
swagger_types = {
... | 27.677419 | 94 | 0.582168 |
import pprint
import re
import six
class Thread(object):
swagger_types = {
'scheduled_date': 'str',
'last_updated': 'str',
'status': 'str',
'responses': 'list[Response]',
}
attribute_map = {
'scheduled_date': 'scheduledDate',
'last_updated': 'lastUpdate... | true | true |
1c2bff6e021e13c1039c359c5299324d5c99df91 | 225 | py | Python | mydays/01-03/01.py | josephrewald/100daysofcode-with-python-course | b51dfbf786c1a89694c4661805ef930516683439 | [
"MIT"
] | null | null | null | mydays/01-03/01.py | josephrewald/100daysofcode-with-python-course | b51dfbf786c1a89694c4661805ef930516683439 | [
"MIT"
] | null | null | null | mydays/01-03/01.py | josephrewald/100daysofcode-with-python-course | b51dfbf786c1a89694c4661805ef930516683439 | [
"MIT"
] | null | null | null | from datetime import datetime
from datetime import date
from datetime import timedelta
today = datetime.today()
print(today)
t = timedelta(days=4, hours=10)
second = timedelta(seconds=1)
seconds = t/second
print(seconds)
| 16.071429 | 31 | 0.773333 | from datetime import datetime
from datetime import date
from datetime import timedelta
today = datetime.today()
print(today)
t = timedelta(days=4, hours=10)
second = timedelta(seconds=1)
seconds = t/second
print(seconds)
| true | true |
1c2c000c1996218df929d4fbfc623e469922b650 | 677 | py | Python | myapp/models.py | Palash51/kd | 2f28adbff98756a84906a4170b428c3298e9273d | [
"MIT"
] | null | null | null | myapp/models.py | Palash51/kd | 2f28adbff98756a84906a4170b428c3298e9273d | [
"MIT"
] | null | null | null | myapp/models.py | Palash51/kd | 2f28adbff98756a84906a4170b428c3298e9273d | [
"MIT"
] | null | null | null | # from django.db import models
# # Create your models here.
# class RegistrationForm(models.Model):
# first_name = models.CharField(max_length=45)
# last_name = models.CharField(max_length=45)
# email = models.EmailField()
# password = models.CharField(max_length=100)#,widget=models.PasswordInput)
# confirm_pass... | 32.238095 | 84 | 0.781388 |
from __future__ import unicode_literals
from django.db import models
class Crop_details(models.Model):
Name = models.CharField(max_length=30)
Phone = models.IntegerField()
FieldLocation = models.CharField(max_length=30)
CropAcres = models.IntegerField() | true | true |
1c2c00a0ece3ea72ebeb3dcb891cf8b8a73360b4 | 11,136 | py | Python | euca2ools/commands/argtypes.py | sjones4/euca2ools | 03b0e421eeebd8f402422a0ad6994bd6ee4e4127 | [
"BSD-2-Clause"
] | null | null | null | euca2ools/commands/argtypes.py | sjones4/euca2ools | 03b0e421eeebd8f402422a0ad6994bd6ee4e4127 | [
"BSD-2-Clause"
] | null | null | null | euca2ools/commands/argtypes.py | sjones4/euca2ools | 03b0e421eeebd8f402422a0ad6994bd6ee4e4127 | [
"BSD-2-Clause"
] | null | null | null | # Copyright 2012-2014 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 conditions ... | 38.532872 | 79 | 0.599497 |
import argparse
import base64
import sys
from requestbuilder import EMPTY
def manifest_block_device_mappings(mappings_as_str):
mappings = {}
mapping_strs = mappings_as_str.split(',')
for mapping_str in mapping_strs:
if mapping_str.strip():
bits = mapping_str.strip().split('=')
... | true | true |
1c2c0160bc99a9415b825ead5aeb916195464fa4 | 1,773 | py | Python | RecursiveDescentAnalysis/TheoreticalParser.py | Miosolo/C-Lanaguage-Compiler | f38459e0a27b0e71eaad81fe3d3c25d72f3a0ca0 | [
"MIT"
] | null | null | null | RecursiveDescentAnalysis/TheoreticalParser.py | Miosolo/C-Lanaguage-Compiler | f38459e0a27b0e71eaad81fe3d3c25d72f3a0ca0 | [
"MIT"
] | null | null | null | RecursiveDescentAnalysis/TheoreticalParser.py | Miosolo/C-Lanaguage-Compiler | f38459e0a27b0e71eaad81fe3d3c25d72f3a0ca0 | [
"MIT"
] | null | null | null |
class Parser(object):
V_N = ['E', 'e', 'T', 't', 'F']
first = {
'E': ['(', 'i'],
'e': ['+', '-'],
'T': ['(', 'i'],
't': ['*', '/'],
'F': ['(', 'i']
}
follow = {
'E': [')', '#'],
'e': [')', '#'],
'T': ['+', '-', '#', ')'],
't': ['+', '-', '#', ')'],
'F': ['+', '-', '*',... | 23.025974 | 109 | 0.400451 |
class Parser(object):
V_N = ['E', 'e', 'T', 't', 'F']
first = {
'E': ['(', 'i'],
'e': ['+', '-'],
'T': ['(', 'i'],
't': ['*', '/'],
'F': ['(', 'i']
}
follow = {
'E': [')', '#'],
'e': [')', '#'],
'T': ['+', '-', '#', ')'],
't': ['+', '-', '#', ')'],
'F': ['+', '-', '*',... | true | true |
1c2c01ba70600600132778eea97a6611aed1f678 | 7,415 | py | Python | script.py | cgalaz01/acur_mri | 3be85e62a3362f9498169edb87c233e4da35ddd8 | [
"MIT"
] | null | null | null | script.py | cgalaz01/acur_mri | 3be85e62a3362f9498169edb87c233e4da35ddd8 | [
"MIT"
] | null | null | null | script.py | cgalaz01/acur_mri | 3be85e62a3362f9498169edb87c233e4da35ddd8 | [
"MIT"
] | null | null | null | import argparse
from pathlib import Path
from functions import anonymise_mri, catalogue, dicom_sort, sequence
def parse_arguments() -> argparse.Namespace:
"""
Defines all accepted arguments.
Returns
-------
args : argparse.Namespace
Values of the passed arguments.
"""
p... | 30.142276 | 94 | 0.599191 | import argparse
from pathlib import Path
from functions import anonymise_mri, catalogue, dicom_sort, sequence
def parse_arguments() -> argparse.Namespace:
parser = argparse.ArgumentParser(description='Script to prepare the data.' +
'One flag should be given at a time... | true | true |
1c2c01cdaa60e2de80735ae30dcb81a40e4f8ccd | 3,055 | py | Python | python/chapter10.py | Rokon-Uz-Zaman/thinkdiff_python_django | 5010c5f1dd8a028fb9e5235319bb6bb434831e6c | [
"MIT"
] | 92 | 2018-04-03T20:53:07.000Z | 2022-03-04T05:53:10.000Z | python-language/python-beginner/chapter10.py | mostafijur-rahman299/thinkdiff | b0e0c01fe38c406f4dfa8cc80b2f0c5654017079 | [
"MIT"
] | 11 | 2018-10-01T15:35:33.000Z | 2021-09-01T04:59:56.000Z | python-language/python-beginner/chapter10.py | mostafijur-rahman299/thinkdiff | b0e0c01fe38c406f4dfa8cc80b2f0c5654017079 | [
"MIT"
] | 98 | 2018-03-13T08:03:54.000Z | 2022-03-22T08:11:44.000Z | # author: Mahmud Ahsan
# code: https://github.com/mahmudahsan/thinkdiff
# blog: http://thinkdiff.net
# http://pythonbangla.com
# MIT License
# --------------------
# Exception
# --------------------
'''
Exception are object in Python that arise runtime to handle error
'''
## Hello Exception
def div(x, y):
re... | 20.782313 | 65 | 0.582651 |
def div(x, y):
return x / y
print ( div(4, 2) )
def div(x, y):
try:
result = x / y
except ZeroDivisionError:
print ("Can not divide by zero")
return None
return result
print ( div(4, 2) )
print ( div(2, 0) )
def div(x, y):
try:
result = x / y
... | true | true |
1c2c0229bf58ba5a5e012acacea611bd236757cd | 1,502 | py | Python | pyzoo/test/zoo/orca/data/conftest.py | thalvari/analytics-zoo | 4f4c5095c3db9363f5a23ca312a95bbdc6a3db91 | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/orca/data/conftest.py | thalvari/analytics-zoo | 4f4c5095c3db9363f5a23ca312a95bbdc6a3db91 | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/orca/data/conftest.py | thalvari/analytics-zoo | 4f4c5095c3db9363f5a23ca312a95bbdc6a3db91 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 33.377778 | 77 | 0.684421 | import os
from zoo.orca import OrcaContext
import pytest
sc = None
ray_ctx = None
@pytest.fixture(autouse=True, scope='package')
def orca_data_fixture():
from zoo import init_spark_on_local
from zoo.ray import RayContext
OrcaContext._eager_mode = True
sc = init_spark_on_local(cores=4, spark_log_leve... | true | true |
1c2c02353792b04153b879efbe0813a32e4c9f76 | 672 | py | Python | 01. RPI - Python - Blink an LED/main.py | wyliodrinstudio/tutorials | bbb982fd2cae848d2b5d9e45a1d0408df9ced811 | [
"Apache-2.0"
] | null | null | null | 01. RPI - Python - Blink an LED/main.py | wyliodrinstudio/tutorials | bbb982fd2cae848d2b5d9e45a1d0408df9ced811 | [
"Apache-2.0"
] | null | null | null | 01. RPI - Python - Blink an LED/main.py | wyliodrinstudio/tutorials | bbb982fd2cae848d2b5d9e45a1d0408df9ced811 | [
"Apache-2.0"
] | null | null | null | import RPi.GPIO as GPIO #import Raspberry Pi GPIO library
from time import sleep #import the sleep method from time module
GPIO.setmode(GPIO.BOARD) #setup BOARD numbering
GPIO.setup(11, GPIO.OUT) #set pin 11 as output
try:
while True: #run... | 44.8 | 78 | 0.543155 | import RPi.GPIO as GPIO from time import sleep
GPIO.setmode(GPIO.BOARD) GPIO.setup(11, GPIO.OUT)
try:
while True: GPIO.output(11, 1) sleep(1) GPIO.output(11, 0) sleep(0.5) ... | true | true |
1c2c02fbc031c0a65d193085f3e43db29743163b | 1,449 | py | Python | WEEKS/CD_Sata-Structures/general/practice/PYTHON/09 - allLongestStrings.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/general/practice/PYTHON/09 - allLongestStrings.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/general/practice/PYTHON/09 - allLongestStrings.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | """Given an array of strings, return another array containing all of its longest strings.
Example:
For inputArray = ["aba", "aa", "ad", "vcd", "aba"], the output should be allLongestStrings(inputArray) = ["aba", "vcd", "aba"]."""
def allLongestStrings(inputArray):
# Step 1: We begin by defining an empty array ca... | 63 | 133 | 0.715666 |
def allLongestStrings(inputArray):
max_arr = []
# You are free to test it on a random input array containing various random strings, using a Python compiler online.
max_len = len(max(inputArray, key=len))
# Step 3: Now, we go over all strings inside the input array checking if thei... | true | true |
1c2c033ff22bbc05914c0d7d30afc0d5506fdeec | 19,440 | py | Python | salt/modules/boto_asg.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | salt/modules/boto_asg.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | salt/modules/boto_asg.py | robmessick/salt | 95b44af831eeca3df261b3d61b7519fbd65319c6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Connection module for Amazon Autoscale Groups
.. versionadded:: 2014.7.0
:configuration: This module accepts explicit autoscale credentials but can also
utilize IAM roles assigned to the instance trough Instance Profiles.
Dynamic credentials are then automatically obtained from AWS... | 37.31286 | 190 | 0.639712 |
import logging
import json
import yaml
import email.mime.multipart
log = logging.getLogger(__name__)
try:
import boto
import boto.ec2
import boto.ec2.blockdevicemapping as blockdevicemapping
import boto.ec2.autoscale as autoscale
logging.getLogger('boto').setLevel(logging.CRITICAL)
HAS_BOTO =... | true | true |
1c2c03a70656d1a7b8ce7938f0d27478e07cf865 | 1,559 | py | Python | project/api/views.py | milkOSTpyt/Goods-accounting-system | ec223ed726cfa9f18d49c4233f9dc1520373c874 | [
"BSD-3-Clause"
] | null | null | null | project/api/views.py | milkOSTpyt/Goods-accounting-system | ec223ed726cfa9f18d49c4233f9dc1520373c874 | [
"BSD-3-Clause"
] | null | null | null | project/api/views.py | milkOSTpyt/Goods-accounting-system | ec223ed726cfa9f18d49c4233f9dc1520373c874 | [
"BSD-3-Clause"
] | null | null | null | from rest_framework.viewsets import ModelViewSet
from rest_framework import permissions
from rest_framework.generics import ListAPIView
from django_filters.rest_framework import DjangoFilterBackend
from app.models import Product, Category, Shop, Warehouse
from .serializers import (ProductSerializer,
... | 33.170213 | 64 | 0.736369 | from rest_framework.viewsets import ModelViewSet
from rest_framework import permissions
from rest_framework.generics import ListAPIView
from django_filters.rest_framework import DjangoFilterBackend
from app.models import Product, Category, Shop, Warehouse
from .serializers import (ProductSerializer,
... | true | true |
1c2c04346d29c864bf3b404ac8b16744e1a6c5f6 | 2,850 | py | Python | benchmark.py | padix-key/fastpdb | 016c0211743fcbf4366fdaf6fb5579ff073c6274 | [
"BSD-3-Clause"
] | 2 | 2021-11-12T18:54:09.000Z | 2022-03-29T10:20:28.000Z | benchmark.py | biotite-dev/fastpdb | 016c0211743fcbf4366fdaf6fb5579ff073c6274 | [
"BSD-3-Clause"
] | null | null | null | benchmark.py | biotite-dev/fastpdb | 016c0211743fcbf4366fdaf6fb5579ff073c6274 | [
"BSD-3-Clause"
] | null | null | null | import time
import tempfile
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import biotite.database.rcsb as rcsb
import biotite.structure.info as info
import biotite.structure.io.pdb as pdb
import fastpdb
REPEATS = 1000
PDB_ID = "1AKI"
WIDTH = 0.25
# Call this... | 28.217822 | 77 | 0.723158 | import time
import tempfile
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np
import biotite.database.rcsb as rcsb
import biotite.structure.info as info
import biotite.structure.io.pdb as pdb
import fastpdb
REPEATS = 1000
PDB_ID = "1AKI"
WIDTH = 0.25
info.bond_d... | true | true |
1c2c05041b07e62bc9988d892ca411996f34d53f | 2,665 | py | Python | basecase.py | sibson/dynoup | 6f43c92c82f41bf9c1e3efeeca05bf8f566a4cf5 | [
"MIT"
] | 1 | 2020-09-13T17:26:31.000Z | 2020-09-13T17:26:31.000Z | basecase.py | sibson/dynoup | 6f43c92c82f41bf9c1e3efeeca05bf8f566a4cf5 | [
"MIT"
] | 3 | 2015-09-23T17:01:02.000Z | 2015-11-21T03:58:13.000Z | basecase.py | sibson/dynoup | 6f43c92c82f41bf9c1e3efeeca05bf8f566a4cf5 | [
"MIT"
] | null | null | null | from contextlib import contextmanager
import json
import os
import logging
from unittest import TestCase
from flask import appcontext_pushed, g
import responses
from dynoup import app, db
from scaler import models
class HerokuBouncerTestDoubleMiddleWare(object):
def __init__(self, app):
self._app = app... | 28.052632 | 119 | 0.63152 | from contextlib import contextmanager
import json
import os
import logging
from unittest import TestCase
from flask import appcontext_pushed, g
import responses
from dynoup import app, db
from scaler import models
class HerokuBouncerTestDoubleMiddleWare(object):
def __init__(self, app):
self._app = app... | true | true |
1c2c05bf84b5f4c73f4eca061fdcd88f931bb816 | 4,677 | py | Python | examples/set_mnist_gan.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 18 | 2019-05-02T16:32:15.000Z | 2021-04-16T09:33:54.000Z | examples/set_mnist_gan.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 5 | 2019-10-14T13:46:49.000Z | 2021-06-08T11:48:34.000Z | examples/set_mnist_gan.py | bobelly/torchsupport | 5aa0a04f20c193ec99310f5d6a3375d2e95e740d | [
"MIT"
] | 12 | 2019-05-12T21:34:24.000Z | 2021-07-15T14:14:16.000Z | import random
import torch
import torch.nn as nn
import torch.nn.functional as func
from torch.nn.utils import spectral_norm
from torch.utils.data import Dataset
from torch.distributions import Normal
from torchvision.datasets import MNIST
from torchvision.transforms import ToTensor
from torchsupport.modules.basic i... | 31.816327 | 111 | 0.6904 | import random
import torch
import torch.nn as nn
import torch.nn.functional as func
from torch.nn.utils import spectral_norm
from torch.utils.data import Dataset
from torch.distributions import Normal
from torchvision.datasets import MNIST
from torchvision.transforms import ToTensor
from torchsupport.modules.basic i... | true | true |
1c2c0732857dffb457209f64f936c6c97ee67f82 | 49 | py | Python | writer/__init__.py | thsis/timesheets | fa849e0e67aac30de777312adc5b232aa79ecb31 | [
"WTFPL"
] | 3 | 2020-07-26T18:04:37.000Z | 2022-02-08T13:27:47.000Z | writer/__init__.py | thsis/timesheets | fa849e0e67aac30de777312adc5b232aa79ecb31 | [
"WTFPL"
] | null | null | null | writer/__init__.py | thsis/timesheets | fa849e0e67aac30de777312adc5b232aa79ecb31 | [
"WTFPL"
] | null | null | null | from ._writer import Writer
__all__ = ["Writer"] | 16.333333 | 27 | 0.734694 | from ._writer import Writer
__all__ = ["Writer"] | true | true |
1c2c077f814bee6ca3254a928438dc8c529d69d6 | 12,450 | py | Python | guilded/user.py | ShashankKumarSaxena/enhanced-guilded.py | 285bf65f115362f69b36547ad77dc02598a70e28 | [
"MIT"
] | null | null | null | guilded/user.py | ShashankKumarSaxena/enhanced-guilded.py | 285bf65f115362f69b36547ad77dc02598a70e28 | [
"MIT"
] | null | null | null | guilded/user.py | ShashankKumarSaxena/enhanced-guilded.py | 285bf65f115362f69b36547ad77dc02598a70e28 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020-present shay (shayypy)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | 33.2 | 90 | 0.621526 |
import guilded.abc
from .colour import Colour
from .utils import ISO8601, parse_hex_number
from .file import File, MediaType
class Device:
def __init__(self, data):
self.type = data.get('type')
self.id = data.get('id')
self.last_online = ISO8601(data.get('lastOnline'))
self.activ... | true | true |
1c2c087406338bf6b6a5c280270dabf1873aef85 | 6,991 | py | Python | plotting.py | KonstantinIvanchenko/selfdriving_env_sim | 2e524c9a7164020a0bc35af4f1b6556777a8289c | [
"MIT"
] | 1 | 2020-08-26T19:41:02.000Z | 2020-08-26T19:41:02.000Z | plotting.py | KonstantinIvanchenko/selfdriving_env_sim | 2e524c9a7164020a0bc35af4f1b6556777a8289c | [
"MIT"
] | null | null | null | plotting.py | KonstantinIvanchenko/selfdriving_env_sim | 2e524c9a7164020a0bc35af4f1b6556777a8289c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
# Modified work: Konstantin Ivanchenko
# Date: December 25, 2019
from external_source import live_plotter as lp
class MotionPlotter(object):
def __init__(self, waypoints,... | 46.919463 | 115 | 0.506508 |
from external_source import live_plotter as lp
class MotionPlotter(object):
def __init__(self, waypoints, num_local_path, trajectory = True, controls = True):
self.tr_plot = lp.LivePlotter(tk_title="Trajectory Visualization")
self.ct_plot = lp.LivePlotter(tk_title="Control Outputs")
sel... | true | true |
1c2c08fa5eda507ae606cd60e1248cb0e025213c | 1,650 | py | Python | store/store_de_ro_prices.py | rkneusel9/SwarmOptimization | 5445b6f90ab49339ca0fdb71e98d44e6827c95a8 | [
"MIT"
] | 2 | 2022-01-11T17:14:14.000Z | 2022-03-07T10:22:32.000Z | store/store_de_ro_prices.py | rkneusel9/SwarmOptimization | 5445b6f90ab49339ca0fdb71e98d44e6827c95a8 | [
"MIT"
] | null | null | null | store/store_de_ro_prices.py | rkneusel9/SwarmOptimization | 5445b6f90ab49339ca0fdb71e98d44e6827c95a8 | [
"MIT"
] | 1 | 2021-11-24T01:11:49.000Z | 2021-11-24T01:11:49.000Z | import numpy as np
import pickle
import matplotlib.pylab as plt
d = pickle.load(open("de_50_40_16000_results.pkl","rb"))
r = pickle.load(open("ro_50_40_16000_results.pkl","rb"))
#g = pickle.load(open("ga_50_40_16000_results.pkl","rb"))
p = np.array(pickle.load(open("products.pkl","rb"))[-1])
w = np.array(pickle.load(o... | 36.666667 | 70 | 0.661818 | import numpy as np
import pickle
import matplotlib.pylab as plt
d = pickle.load(open("de_50_40_16000_results.pkl","rb"))
r = pickle.load(open("ro_50_40_16000_results.pkl","rb"))
p = np.array(pickle.load(open("products.pkl","rb"))[-1])
w = np.array(pickle.load(open("products.pkl","rb"))[0])
w = w / w.sum()
de = p[np... | true | true |
1c2c09d0914ee6083d8ca37494180d973848f2ef | 10,083 | py | Python | pcp_utils/cameras.py | YunchuZhang/Visually-Grounded-Library-of-Behaviors-for-Generalizing-Manipulation-Across-Objects-Configurations- | 896afda942dfc04e4aaad2ee751c32df1eb17913 | [
"MIT"
] | 1 | 2022-03-14T22:25:17.000Z | 2022-03-14T22:25:17.000Z | pcp_utils/cameras.py | YunchuZhang/Visually-Grounded-Library-of-Behaviors | 896afda942dfc04e4aaad2ee751c32df1eb17913 | [
"MIT"
] | null | null | null | pcp_utils/cameras.py | YunchuZhang/Visually-Grounded-Library-of-Behaviors | 896afda942dfc04e4aaad2ee751c32df1eb17913 | [
"MIT"
] | null | null | null | import numpy as np
import math
from scipy.linalg import inv, sqrtm
import transformations
def sym(w):
return w.dot(inv(sqrtm(w.T.dot(w))))
def render_images(env, camera_img_height, camera_img_width, camera_fov, camera_positions, camera_quats, camera_name="ext_camera_0"):
"""
go through all the cameras ... | 33.277228 | 134 | 0.632748 | import numpy as np
import math
from scipy.linalg import inv, sqrtm
import transformations
def sym(w):
return w.dot(inv(sqrtm(w.T.dot(w))))
def render_images(env, camera_img_height, camera_img_width, camera_fov, camera_positions, camera_quats, camera_name="ext_camera_0"):
n_cams = len(camera_positions)
... | true | true |
1c2c0a04625db08cdc0b0f638973ec5905bc5218 | 1,924 | py | Python | tests/profiler_test.py | gully/jax | eb086f9b22154104b216b22ed006264989bcad41 | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2021-04-02T03:46:28.000Z | 2021-12-04T22:52:50.000Z | tests/profiler_test.py | gully/jax | eb086f9b22154104b216b22ed006264989bcad41 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-10-01T05:38:44.000Z | 2020-10-01T05:38:44.000Z | tests/profiler_test.py | gully/jax | eb086f9b22154104b216b22ed006264989bcad41 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-08-28T18:42:08.000Z | 2020-08-28T18:42:08.000Z | # 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 26.722222 | 77 | 0.723493 |
from functools import partial
import unittest
from absl.testing import absltest
import jax
import jax.numpy as jnp
import jax.profiler
from jax.config import config
import jax.test_util as jtu
try:
import portpicker
except ImportError:
portpicker = None
config.parse_flags_with_absl()
class ProfilerTest(unitt... | true | true |
1c2c0a3497a3a7dcde3159a8843df11d37a8f392 | 1,381 | py | Python | rplugin/python3/defx/column/size.py | sahwar/defx.nvim | bdd4896617f91800932ba2aaa4b2d019ae75ef1c | [
"MIT"
] | 1 | 2019-04-14T20:18:26.000Z | 2019-04-14T20:18:26.000Z | rplugin/python3/defx/column/size.py | sahwar/defx.nvim | bdd4896617f91800932ba2aaa4b2d019ae75ef1c | [
"MIT"
] | null | null | null | rplugin/python3/defx/column/size.py | sahwar/defx.nvim | bdd4896617f91800932ba2aaa4b2d019ae75ef1c | [
"MIT"
] | null | null | null | # ============================================================================
# FILE: size.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
from defx.base.column import Base
from defx.context import Context... | 30.021739 | 78 | 0.5105 |
from defx.base.column import Base
from defx.context import Context
from defx.util import Nvim, readable
import typing
class Column(Base):
def __init__(self, vim: Nvim) -> None:
super().__init__(vim)
self.name = 'size'
def get(self, context: Context,
candidate: typing.Dict[str,... | true | true |
1c2c0c1f0313760161119e12ed53273a0b730353 | 7,463 | py | Python | turtlefy/resources.py | nprutan/turtlefy | 45ff9b592047607d04142f34fe30d0987c5052c5 | [
"MIT"
] | 1 | 2022-03-27T03:44:10.000Z | 2022-03-27T03:44:10.000Z | turtlefy/resources.py | nprutan/turtlefy | 45ff9b592047607d04142f34fe30d0987c5052c5 | [
"MIT"
] | null | null | null | turtlefy/resources.py | nprutan/turtlefy | 45ff9b592047607d04142f34fe30d0987c5052c5 | [
"MIT"
] | null | null | null |
def extract_tags(tags):
return [tag.strip().lower() for tag in tags.split(',')]
def append_tags(tags, new_tag):
if tags:
split_tags = tags.split(',')
split_tags.append(f' {new_tag}')
return ','.join(split_tags)
return new_tag
def tag_resource(client, resource, new_tag, resource_... | 30.711934 | 107 | 0.627228 |
def extract_tags(tags):
return [tag.strip().lower() for tag in tags.split(',')]
def append_tags(tags, new_tag):
if tags:
split_tags = tags.split(',')
split_tags.append(f' {new_tag}')
return ','.join(split_tags)
return new_tag
def tag_resource(client, resource, new_tag, resource_... | true | true |
1c2c0c2698e23924b849d04cd00c551d44130204 | 31,748 | py | Python | Lib/test/test_warnings.py | akruis/stackless_historic | f8af5dd49558f0ef046cf99dc5d34db2b9a90ce2 | [
"PSF-2.0"
] | 1 | 2019-05-14T05:05:42.000Z | 2019-05-14T05:05:42.000Z | Lib/test/test_warnings.py | akruis/stackless_historic | f8af5dd49558f0ef046cf99dc5d34db2b9a90ce2 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_warnings.py | akruis/stackless_historic | f8af5dd49558f0ef046cf99dc5d34db2b9a90ce2 | [
"PSF-2.0"
] | 2 | 2018-07-15T06:35:21.000Z | 2019-05-14T05:05:31.000Z | from contextlib import contextmanager
import linecache
import os
import StringIO
import sys
import unittest
import subprocess
from test import test_support
from test.script_helper import assert_python_ok
import warning_tests
import warnings as original_warnings
py_warnings = test_support.import_fresh_module('warning... | 42.330667 | 81 | 0.602085 | from contextlib import contextmanager
import linecache
import os
import StringIO
import sys
import unittest
import subprocess
from test import test_support
from test.script_helper import assert_python_ok
import warning_tests
import warnings as original_warnings
py_warnings = test_support.import_fresh_module('warning... | true | true |
1c2c0c82cb420667a554255138ca41a2122bf774 | 1,187 | py | Python | tests/conda_env/utils/test_uploader.py | richmoore1962/conda | ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306 | [
"BSD-3-Clause"
] | 107 | 2015-01-31T18:25:22.000Z | 2021-06-12T16:33:26.000Z | tests/conda_env/utils/test_uploader.py | richmoore1962/conda | ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306 | [
"BSD-3-Clause"
] | 213 | 2015-01-06T17:47:59.000Z | 2017-06-02T11:54:22.000Z | tests/conda_env/utils/test_uploader.py | richmoore1962/conda | ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306 | [
"BSD-3-Clause"
] | 62 | 2015-01-06T15:47:56.000Z | 2021-08-23T05:42:17.000Z | import unittest
try:
from unittest import mock
except ImportError:
import mock
from binstar_client import errors
from conda_env.utils.uploader import Uploader
class UploaderTestCase(unittest.TestCase):
def test_unauthorized(self):
uploader = Uploader('package', 'filename')
with mock.patch.... | 39.566667 | 90 | 0.68829 | import unittest
try:
from unittest import mock
except ImportError:
import mock
from binstar_client import errors
from conda_env.utils.uploader import Uploader
class UploaderTestCase(unittest.TestCase):
def test_unauthorized(self):
uploader = Uploader('package', 'filename')
with mock.patch.... | true | true |
1c2c0ca790fb83c200c37f1ebec40b4841886f8a | 2,477 | py | Python | pyrosm/boundary.py | geoDavey/pyrosm | 9b28714680e93c1f12cf2dc457fbc7d0db1f2798 | [
"MIT"
] | null | null | null | pyrosm/boundary.py | geoDavey/pyrosm | 9b28714680e93c1f12cf2dc457fbc7d0db1f2798 | [
"MIT"
] | null | null | null | pyrosm/boundary.py | geoDavey/pyrosm | 9b28714680e93c1f12cf2dc457fbc7d0db1f2798 | [
"MIT"
] | null | null | null | from pyrosm.data_manager import get_osm_data
from pyrosm.frames import prepare_geodataframe
from pyrosm.utils import validate_custom_filter
import geopandas as gpd
import warnings
def get_boundary_data(node_coordinates, way_records, relations,
tags_as_columns, custom_filter,
... | 39.951613 | 89 | 0.557529 | from pyrosm.data_manager import get_osm_data
from pyrosm.frames import prepare_geodataframe
from pyrosm.utils import validate_custom_filter
import geopandas as gpd
import warnings
def get_boundary_data(node_coordinates, way_records, relations,
tags_as_columns, custom_filter,
... | true | true |
1c2c0d85d4fc5bb563185b72458addcfa70657d8 | 143 | py | Python | xv_leak_tools/test_components/vpn_application/mobile_vpn_application.py | UAEKondaya1/expressvpn_leak_testing | 9e4cee899ac04f7820ac351fa55efdc0c01370ba | [
"MIT"
] | 219 | 2017-12-12T09:42:46.000Z | 2022-03-13T08:25:13.000Z | xv_leak_tools/test_components/vpn_application/mobile_vpn_application.py | UAEKondaya1/expressvpn_leak_testing | 9e4cee899ac04f7820ac351fa55efdc0c01370ba | [
"MIT"
] | 11 | 2017-12-14T08:14:51.000Z | 2021-08-09T18:37:45.000Z | xv_leak_tools/test_components/vpn_application/mobile_vpn_application.py | UAEKondaya1/expressvpn_leak_testing | 9e4cee899ac04f7820ac351fa55efdc0c01370ba | [
"MIT"
] | 45 | 2017-12-14T07:26:36.000Z | 2022-03-11T09:36:56.000Z | from xv_leak_tools.test_components.vpn_application.vpn_application import VPNApplication
class MobileVPNApplication(VPNApplication):
pass
| 28.6 | 88 | 0.874126 | from xv_leak_tools.test_components.vpn_application.vpn_application import VPNApplication
class MobileVPNApplication(VPNApplication):
pass
| true | true |
1c2c0e2371d49e308a5a1275f651283e3e0a2f39 | 4,190 | py | Python | test/oauth_sig_check_test.py | rhargreaves/fastly-vcl-experiments | 1514ee06ed5848c4c3701b10a46035b5d2a89277 | [
"MIT"
] | 3 | 2016-03-08T09:21:09.000Z | 2016-04-13T21:20:00.000Z | test/oauth_sig_check_test.py | rhargreaves/fastly-vcl-experiments | 1514ee06ed5848c4c3701b10a46035b5d2a89277 | [
"MIT"
] | null | null | null | test/oauth_sig_check_test.py | rhargreaves/fastly-vcl-experiments | 1514ee06ed5848c4c3701b10a46035b5d2a89277 | [
"MIT"
] | null | null | null | import requests
import os
from requests_oauthlib import OAuth1
from oauthlib.oauth1 import SIGNATURE_TYPE_QUERY
from nose.tools import assert_equals, assert_regex
from freezegun import freeze_time
from datetime import datetime, timedelta
proxies = {
'http': 'http://nonssl.global.fastly.net:80'
}
service_host = os.... | 33.790323 | 70 | 0.670644 | import requests
import os
from requests_oauthlib import OAuth1
from oauthlib.oauth1 import SIGNATURE_TYPE_QUERY
from nose.tools import assert_equals, assert_regex
from freezegun import freeze_time
from datetime import datetime, timedelta
proxies = {
'http': 'http://nonssl.global.fastly.net:80'
}
service_host = os.... | true | true |
1c2c0f6de6cac6a96bebc2635b3a7d347d09f9f8 | 2,026 | py | Python | tests/interplanetary_test.py | tomaszmrugalski/astro | c4d270a8d7830fcf799c2cbafe7f7b2070072cc9 | [
"MIT"
] | null | null | null | tests/interplanetary_test.py | tomaszmrugalski/astro | c4d270a8d7830fcf799c2cbafe7f7b2070072cc9 | [
"MIT"
] | null | null | null | tests/interplanetary_test.py | tomaszmrugalski/astro | c4d270a8d7830fcf799c2cbafe7f7b2070072cc9 | [
"MIT"
] | null | null | null | from astropy import units as u
from perylune import interplanetary
from perylune.orbit_tools import *
from poliastro.twobody import Orbit
from poliastro.bodies import Earth, Sun
import numpy as np
from test_tools import *
def test_escape_velocity():
# TEST CASE 1:
# This is circular orbit, the escape veloci... | 34.931034 | 107 | 0.619941 | from astropy import units as u
from perylune import interplanetary
from perylune.orbit_tools import *
from poliastro.twobody import Orbit
from poliastro.bodies import Earth, Sun
import numpy as np
from test_tools import *
def test_escape_velocity():
o1 = Orbit.circular(Earth, 0*u.km)
v,vp,va = i... | true | true |
1c2c100c56a532209cbf6ee9cbafb965b65a8d85 | 9,978 | py | Python | rcnn/fio/rpn.py | truetqy/lesion_det_dual_att | 5a5a77dd7f3aa195a2f5b84169822eb32c396d65 | [
"Apache-2.0"
] | 1 | 2020-02-25T02:25:44.000Z | 2020-02-25T02:25:44.000Z | rcnn/fio/rpn.py | truetqy/lesion_det_dual_att | 5a5a77dd7f3aa195a2f5b84169822eb32c396d65 | [
"Apache-2.0"
] | null | null | null | rcnn/fio/rpn.py | truetqy/lesion_det_dual_att | 5a5a77dd7f3aa195a2f5b84169822eb32c396d65 | [
"Apache-2.0"
] | 1 | 2020-06-16T03:07:35.000Z | 2020-06-16T03:07:35.000Z | """
RPN:
data =
{'data': [num_images, c, h, w],
'im_info': [num_images, 4] (optional)}
label =
{'gt_boxes': [num_boxes, 5] (optional),
'label': [batch_size, 1] <- [batch_size, num_anchors, feat_height, feat_width],
'bbox_target': [batch_size, num_anchors, feat_height, feat_width],
'... | 43.008621 | 105 | 0.620265 |
import logging
import numpy as np
import numpy.random as npr
from ..logger import logger
from ..config import config
from .image import get_image, tensor_vstack
from ..processing.generate_anchor import generate_anchors
from ..processing.bbox_transform import bbox_overlaps, bbox_transform
def get_rpn_tes... | true | true |
1c2c102002b7e18f4787617786c66338410a3d69 | 329 | py | Python | video_behavior_tracking/__init__.py | droumis/video_behavior_tracking | 98b031a4a8dda1c0112f823b661ebad2feeaa43e | [
"MIT"
] | 1 | 2018-10-01T23:33:44.000Z | 2018-10-01T23:33:44.000Z | video_behavior_tracking/__init__.py | droumis/video_behavior_tracking | 98b031a4a8dda1c0112f823b661ebad2feeaa43e | [
"MIT"
] | 1 | 2020-01-07T01:55:30.000Z | 2020-01-07T01:55:30.000Z | video_behavior_tracking/__init__.py | droumis/video_behavior_tracking | 98b031a4a8dda1c0112f823b661ebad2feeaa43e | [
"MIT"
] | 2 | 2018-11-15T00:14:35.000Z | 2020-11-16T07:50:09.000Z | # flake8: noqa
from .kalman import extract_position_data
from .labeled_video import make_video
from .LED_detection import detect_LEDs
from .utils import (adjust_time, convert_to_loren_frank_data_format,
position_dataframe, save_loren_frank_data,
video_filename_to_epoch_key, write... | 41.125 | 68 | 0.765957 | from .kalman import extract_position_data
from .labeled_video import make_video
from .LED_detection import detect_LEDs
from .utils import (adjust_time, convert_to_loren_frank_data_format,
position_dataframe, save_loren_frank_data,
video_filename_to_epoch_key, write_config)
| true | true |
1c2c109217c571684466b1b495a7f7640861afc1 | 12,450 | py | Python | src/sage/combinat/integer_vector_weighted.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 1,742 | 2015-01-04T07:06:13.000Z | 2022-03-30T11:32:52.000Z | src/sage/combinat/integer_vector_weighted.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 66 | 2015-03-19T19:17:24.000Z | 2022-03-16T11:59:30.000Z | src/sage/combinat/integer_vector_weighted.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | 495 | 2015-01-10T10:23:18.000Z | 2022-03-24T22:06:11.000Z | """
Weighted Integer Vectors
AUTHORS:
- Mike Hansen (2007): initial version, ported from MuPAD-Combinat
- Nicolas M. Thiery (2010-10-30): WeightedIntegerVectors(weights) + cleanup
"""
# ****************************************************************************
# Copyright (C) 2007 Mike Hansen <mhansen@gmail.com>
#... | 30.970149 | 125 | 0.521446 |
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
from sage.categories.sets_with_grading import SetsWithGradin... | true | true |
1c2c10e98592060422a387974b993eddbea876b7 | 665 | py | Python | appSchool/migrations/0002_auto_20190510_1914.py | NandyAkash/Sma | 60b247d7b213516b94347626d09a8f329a70aa90 | [
"MIT"
] | null | null | null | appSchool/migrations/0002_auto_20190510_1914.py | NandyAkash/Sma | 60b247d7b213516b94347626d09a8f329a70aa90 | [
"MIT"
] | null | null | null | appSchool/migrations/0002_auto_20190510_1914.py | NandyAkash/Sma | 60b247d7b213516b94347626d09a8f329a70aa90 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-05-10 13:14
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('appSchool', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='groups',
),
... | 20.78125 | 48 | 0.512782 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('appSchool', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='groups',
),
migrations.RemoveField(
model_name='u... | true | true |
1c2c12a5417aed49530556a1a522d4f26674df6b | 2,137 | py | Python | pyshadowsocks/protocol/socks5ssl/__init__.py | FTwOoO/pyShadowsocks | 452323e30c4b97d322cbb67e9bbc7c4549e67b5f | [
"MIT"
] | 21 | 2016-08-01T06:48:01.000Z | 2021-04-05T18:20:53.000Z | pyshadowsocks/protocol/socks5ssl/__init__.py | zen-of-proxy/pyShadowsocks | 452323e30c4b97d322cbb67e9bbc7c4549e67b5f | [
"MIT"
] | 2 | 2016-07-23T02:33:17.000Z | 2018-03-13T09:50:02.000Z | pyshadowsocks/protocol/socks5ssl/__init__.py | FTwOoO/pyShadowsocks | 452323e30c4b97d322cbb67e9bbc7c4549e67b5f | [
"MIT"
] | 7 | 2017-04-22T16:53:53.000Z | 2021-02-08T06:33:05.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: booopooob@gmail.com
#
import os.path
import ssl
import subprocess
import settings
def create_self_signed_certs():
settings.SSL_PUBLIC_FILE = os.path.abspath(settings.SSL_PUBLIC_FILE)
settings.SSL_RPIVATE_FILE = os.path.abspath(settings.SSL_RPIVATE_... | 38.160714 | 108 | 0.652316 |
import os.path
import ssl
import subprocess
import settings
def create_self_signed_certs():
settings.SSL_PUBLIC_FILE = os.path.abspath(settings.SSL_PUBLIC_FILE)
settings.SSL_RPIVATE_FILE = os.path.abspath(settings.SSL_RPIVATE_FILE)
if not os.path.exists(settings.SSL_PUBLIC_FILE):
os.makedirs(o... | true | true |
1c2c136b8fdad5a79ae05ac836de38ea9dbace3f | 3,773 | py | Python | gcloud/contrib/function/models.py | gangh/bk-sops | 29f4b4915be42650c2eeee637e0cf798e4066f09 | [
"Apache-2.0"
] | 1 | 2019-12-23T07:23:35.000Z | 2019-12-23T07:23:35.000Z | gcloud/contrib/function/models.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 9 | 2020-02-12T03:15:49.000Z | 2021-06-10T22:04:51.000Z | gcloud/contrib/function/models.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 1 | 2022-01-17T11:32:05.000Z | 2022-01-17T11:32:05.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 39.715789 | 115 | 0.675855 |
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from gcloud.core.utils import convert_readable_username
from gcloud.taskflow3.models import TaskFlowInstance
FUNCTION_TASK_STATUS = [
('submitted', _(u"未认领")),
('claimed', _(u"已认领")),
(... | true | true |
1c2c15280a79e91e39d4330bed21a7be832e710f | 1,175 | py | Python | migrations/versions/cb9983b1a2b6_init.py | fengyc/flasky | 49b822f7f8f1f8ec53007d4cc2467e4744fb213a | [
"MIT"
] | null | null | null | migrations/versions/cb9983b1a2b6_init.py | fengyc/flasky | 49b822f7f8f1f8ec53007d4cc2467e4744fb213a | [
"MIT"
] | null | null | null | migrations/versions/cb9983b1a2b6_init.py | fengyc/flasky | 49b822f7f8f1f8ec53007d4cc2467e4744fb213a | [
"MIT"
] | null | null | null | """'init'
Revision ID: cb9983b1a2b6
Revises: None
Create Date: 2016-01-28 21:20:28.690752
"""
# revision identifiers, used by Alembic.
revision = 'cb9983b1a2b6'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op... | 27.97619 | 82 | 0.666383 |
revision = 'cb9983b1a2b6'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('roles',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=64), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('nam... | true | true |
1c2c1604189928c066ede2845d4f2e385835cce4 | 848 | py | Python | utils/config.py | Steve-Tod/3D_generation | 75817f91f4a69da06375b4401d4182e932102cd1 | [
"Apache-2.0"
] | null | null | null | utils/config.py | Steve-Tod/3D_generation | 75817f91f4a69da06375b4401d4182e932102cd1 | [
"Apache-2.0"
] | null | null | null | utils/config.py | Steve-Tod/3D_generation | 75817f91f4a69da06375b4401d4182e932102cd1 | [
"Apache-2.0"
] | 1 | 2019-07-24T03:35:27.000Z | 2019-07-24T03:35:27.000Z | import json
from bunch import Bunch
import os
def get_config_from_json(json_file):
"""
Get the config from a json file
:param json_file:
:return: config(namespace) or config(dictionary)
"""
# parse the configurations from the config json file provided
with open(json_file, 'r') as config_fi... | 29.241379 | 75 | 0.646226 | import json
from bunch import Bunch
import os
def get_config_from_json(json_file):
with open(json_file, 'r') as config_file:
config_dict = json.load(config_file)
config = Bunch(config_dict)
return config, config_dict
def process_config(json_file):
config, _ = get_config_from_json(j... | true | true |
1c2c1614938ba23c6d186eff22a13e0ea526a734 | 495 | py | Python | plugins/whois/setup.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 46 | 2019-06-05T20:47:58.000Z | 2022-03-29T10:18:01.000Z | plugins/whois/setup.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 386 | 2019-06-07T20:20:39.000Z | 2022-03-30T17:35:01.000Z | plugins/whois/setup.py | lukaszlaszuk/insightconnect-plugins | 8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892 | [
"MIT"
] | 43 | 2019-07-09T14:13:58.000Z | 2022-03-28T12:04:46.000Z | # GENERATED BY KOMAND SDK - DO NOT EDIT
from setuptools import setup, find_packages
setup(name="whois-rapid7-plugin",
version="3.0.3",
description="The WHOIS plugin enables address and domain lookups in the WHOIS databases",
author="rapid7",
author_email="",
url="",
packages=find_p... | 33 | 120 | 0.684848 | from setuptools import setup, find_packages
setup(name="whois-rapid7-plugin",
version="3.0.3",
description="The WHOIS plugin enables address and domain lookups in the WHOIS databases",
author="rapid7",
author_email="",
url="",
packages=find_packages(),
install_requires=['insi... | true | true |
1c2c1691915643a8ab197499b02cd41d77a3f200 | 29,880 | py | Python | tests/trainer/test_trainer.py | binshengliu/pytorch-lightning | 8f6b7a2b4fea9b7bd0b873f5973e6364b3981412 | [
"Apache-2.0"
] | null | null | null | tests/trainer/test_trainer.py | binshengliu/pytorch-lightning | 8f6b7a2b4fea9b7bd0b873f5973e6364b3981412 | [
"Apache-2.0"
] | null | null | null | tests/trainer/test_trainer.py | binshengliu/pytorch-lightning | 8f6b7a2b4fea9b7bd0b873f5973e6364b3981412 | [
"Apache-2.0"
] | 1 | 2021-03-05T20:59:47.000Z | 2021-03-05T20:59:47.000Z | import glob
import math
import os
import types
from argparse import Namespace
import pytest
import torch
import yaml
import tests.base.utils as tutils
from pytorch_lightning import Callback, LightningModule
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
fr... | 35.111633 | 118 | 0.683969 | import glob
import math
import os
import types
from argparse import Namespace
import pytest
import torch
import yaml
import tests.base.utils as tutils
from pytorch_lightning import Callback, LightningModule
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint
fr... | true | true |
1c2c16caae55b75e2804f678b6f990b595ff904d | 8,503 | py | Python | awips/test/dafTests/testGfeEditArea.py | mjames-upc/python-awips | e2b05f5587b02761df3b6dd5c6ee1f196bd5f11c | [
"BSD-3-Clause"
] | null | null | null | awips/test/dafTests/testGfeEditArea.py | mjames-upc/python-awips | e2b05f5587b02761df3b6dd5c6ee1f196bd5f11c | [
"BSD-3-Clause"
] | null | null | null | awips/test/dafTests/testGfeEditArea.py | mjames-upc/python-awips | e2b05f5587b02761df3b6dd5c6ee1f196bd5f11c | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
from awips.dataaccess import DataAccessLayer as DAL
from awips.ThriftClient import ThriftRequestException
from awips.test.dafTests import baseDafTestCase
from awips.test.dafTests impor... | 42.303483 | 104 | 0.698342 | from __future__ import print_function
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
from awips.dataaccess import DataAccessLayer as DAL
from awips.ThriftClient import ThriftRequestException
from awips.test.dafTests import baseDafTestCase
from awips.test.dafTests impor... | true | true |
1c2c16d48b9a5ebedf2c92de374e40386c398822 | 6,268 | py | Python | core/ook_lib.py | zdx198811/lab604-automation | f73acdce38422d9c3a0845a553efa4eebc662086 | [
"MIT"
] | 1 | 2020-10-30T15:22:20.000Z | 2020-10-30T15:22:20.000Z | core/ook_lib.py | zdx198811/lab604-automation | f73acdce38422d9c3a0845a553efa4eebc662086 | [
"MIT"
] | null | null | null | core/ook_lib.py | zdx198811/lab604-automation | f73acdce38422d9c3a0845a553efa4eebc662086 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jul 2 15:16:16 2018
@author: dongxucz
"""
import numpy as np
import csv as csvlib
from locale import atoi
from os.path import exists
# from torch.utils.data import Dataset
class OOK_signal:
"""Create (randomly generate|load from file) or save an OOK signal.
NOT... | 40.701299 | 130 | 0.57275 |
import numpy as np
import csv as csvlib
from locale import atoi
from os.path import exists
class OOK_signal:
def __init__(self, data_len = 0, data_ref=[], load_file = ''):
if (load_file!=''): if exists(load_file):
if (load_file[-3:]!='csv'):
raise ValueError... | true | true |
1c2c17960aa80e454059311a01f72e7d705ed67e | 279,211 | py | Python | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | AudioStreamTV/tensorflow | 7277ed8ed2da84b227295216632dec52a81f63b3 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | AudioStreamTV/tensorflow | 7277ed8ed2da84b227295216632dec52a81f63b3 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | AudioStreamTV/tensorflow | 7277ed8ed2da84b227295216632dec52a81f63b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.709414 | 85 | 0.64169 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
from six.moves import xrange from tensorflow.contrib import metrics as metrics_lib
from tensorflow.contrib.metrics.python.ops import metric_ops
from tensorflow.python.framework... | true | true |
1c2c17ca3ae40240b1b72a93c6615a29cbb7031c | 2,982 | py | Python | faasmcli/faasmcli/tasks/codegen.py | BieVic/faasm | 90081b3c9596a0f5bfe576725199ad1ef0242f12 | [
"Apache-2.0"
] | 254 | 2018-10-12T10:09:43.000Z | 2020-06-02T17:42:04.000Z | faasmcli/faasmcli/tasks/codegen.py | BieVic/faasm | 90081b3c9596a0f5bfe576725199ad1ef0242f12 | [
"Apache-2.0"
] | 49 | 2019-11-18T17:33:01.000Z | 2020-05-23T13:15:23.000Z | faasmcli/faasmcli/tasks/codegen.py | BieVic/faasm | 90081b3c9596a0f5bfe576725199ad1ef0242f12 | [
"Apache-2.0"
] | 22 | 2019-11-05T15:01:54.000Z | 2020-06-02T17:42:05.000Z | from subprocess import run
from invoke import task
from copy import copy
from os import environ
from os.path import join
from faasmcli.util.codegen import find_codegen_func, find_codegen_shared_lib
from faasmcli.util.env import FAASM_RUNTIME_ROOT
LIB_FAKE_FILES = [
join(FAASM_RUNTIME_ROOT, "lib", "fake", "libfak... | 22.421053 | 76 | 0.595909 | from subprocess import run
from invoke import task
from copy import copy
from os import environ
from os.path import join
from faasmcli.util.codegen import find_codegen_func, find_codegen_shared_lib
from faasmcli.util.env import FAASM_RUNTIME_ROOT
LIB_FAKE_FILES = [
join(FAASM_RUNTIME_ROOT, "lib", "fake", "libfak... | true | true |
1c2c181ecf11238b04a9e12154632e2445d0eb4d | 3,448 | py | Python | testsuite/data/scores/score_api/score_api.py | ICONationDevTeam/goloop | 45241c021e7ba56408b8cc9a1440c965bef28411 | [
"Apache-2.0"
] | 47 | 2020-09-11T01:40:37.000Z | 2022-03-29T02:41:17.000Z | testsuite/data/scores/score_api/score_api.py | pranav925/goloop | 19f19e6ba6ccb25f464ae0cc31b76a9b30a13f0f | [
"Apache-2.0"
] | 41 | 2020-09-11T01:33:13.000Z | 2022-03-22T11:21:53.000Z | testsuite/data/scores/score_api/score_api.py | pranav925/goloop | 19f19e6ba6ccb25f464ae0cc31b76a9b30a13f0f | [
"Apache-2.0"
] | 24 | 2020-09-22T08:23:38.000Z | 2022-03-19T11:14:10.000Z | from iconservice import *
TAG = 'ScoreApi'
class Person(TypedDict):
name: str
age: int
class ScoreApi(IconScoreBase):
def __init__(self, db: IconScoreDatabase) -> None:
super().__init__(db)
def on_install(self) -> None:
super().on_install()
def on_update(self) -> None:
... | 27.806452 | 85 | 0.603538 | from iconservice import *
TAG = 'ScoreApi'
class Person(TypedDict):
name: str
age: int
class ScoreApi(IconScoreBase):
def __init__(self, db: IconScoreDatabase) -> None:
super().__init__(db)
def on_install(self) -> None:
super().on_install()
def on_update(self) -> None:
... | true | true |
1c2c18773aad320c335162241a9041be30c4ee83 | 9,337 | bzl | Python | rules/framework/vfs_overlay.bzl | cdoky/rules_ios | 35c3cbb69a86a0f607b21bd5c65cabcfa3e12666 | [
"Apache-2.0"
] | null | null | null | rules/framework/vfs_overlay.bzl | cdoky/rules_ios | 35c3cbb69a86a0f607b21bd5c65cabcfa3e12666 | [
"Apache-2.0"
] | null | null | null | rules/framework/vfs_overlay.bzl | cdoky/rules_ios | 35c3cbb69a86a0f607b21bd5c65cabcfa3e12666 | [
"Apache-2.0"
] | null | null | null | load("//rules:providers.bzl", "FrameworkInfo")
load("//rules:features.bzl", "feature_names")
FRAMEWORK_SEARCH_PATH = "/build_bazel_rules_ios/frameworks"
VFSOverlayInfo = provider(
doc = "Propagates vfs overlays",
fields = {
"files": "depset with overlays",
"vfs_info": "intneral obj",
},
)
... | 33.46595 | 147 | 0.633501 | load("//rules:providers.bzl", "FrameworkInfo")
load("//rules:features.bzl", "feature_names")
FRAMEWORK_SEARCH_PATH = "/build_bazel_rules_ios/frameworks"
VFSOverlayInfo = provider(
doc = "Propagates vfs overlays",
fields = {
"files": "depset with overlays",
"vfs_info": "intneral obj",
},
)
... | true | true |
1c2c19476fea3bdf4fb4b6553a526732eba38284 | 6,035 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_dashboards_response.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_dashboards_response.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_dashboards_response.py | admariner/polyaxon | ba355c38166047eb11e60de4cee4d7c3b48db323 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 27.939815 | 120 | 0.600663 |
import pprint
import re
import six
from polyaxon_sdk.configuration import Configuration
class V1ListDashboardsResponse(object):
openapi_types = {
'count': 'int',
'results': 'list[V1Dashboard]',
'previous': 'str',
'next': 'str'
}
attribute_map = {
'count': '... | true | true |
1c2c19a12b87b250f7609372d69771a1c72c1620 | 4,740 | py | Python | app/users/migrations/0001_initial.py | chriskmamo/greenvoice | 11306e939612907da21f89350b4446e47081e695 | [
"MIT"
] | null | null | null | app/users/migrations/0001_initial.py | chriskmamo/greenvoice | 11306e939612907da21f89350b4446e47081e695 | [
"MIT"
] | 2 | 2022-02-13T20:16:39.000Z | 2022-02-19T06:27:31.000Z | app/users/migrations/0001_initial.py | chriskmamo/greenvoice | 11306e939612907da21f89350b4446e47081e695 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.10 on 2020-10-10 11:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
... | 60 | 266 | 0.621941 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.Crea... | true | true |
1c2c1a6931ccebf375a10d9ed09224fe6b4d6c2d | 8,204 | py | Python | hyperion/model/image.py | astrofrog/hyperion | e90d7af1df4f064a960594d812c07ff27d87fcc7 | [
"BSD-2-Clause"
] | 2 | 2015-05-14T17:26:16.000Z | 2019-03-13T17:33:18.000Z | hyperion/model/image.py | astrofrog/hyperion | e90d7af1df4f064a960594d812c07ff27d87fcc7 | [
"BSD-2-Clause"
] | null | null | null | hyperion/model/image.py | astrofrog/hyperion | e90d7af1df4f064a960594d812c07ff27d87fcc7 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
from ..util.functions import FreezableClass, is_numpy_array
from ..util.constants import c
class Image(FreezableClass):
"""
Class to represent an image or set of images
Parameters
----------
nu : ndarray
The frequencies at which the image is defined, in Hz
flux : n... | 29.3 | 179 | 0.574963 | import numpy as np
from ..util.functions import FreezableClass, is_numpy_array
from ..util.constants import c
class Image(FreezableClass):
def __init__(self, nu, flux=None, unc=None, units=None):
self.nu = nu
self.flux = flux
self.unc = unc
self.units = units
self.x_min... | true | true |
1c2c1bf41a6b57bdda5539eb2df9272b3e718ab5 | 3,276 | py | Python | setup.py | VincentRPS/hikari-views | b641dd6f02baee144daaa1b41f6337effa870325 | [
"MIT"
] | 1 | 2022-01-31T16:59:55.000Z | 2022-01-31T16:59:55.000Z | setup.py | VincentRPS/hikari-views | b641dd6f02baee144daaa1b41f6337effa870325 | [
"MIT"
] | null | null | null | setup.py | VincentRPS/hikari-views | b641dd6f02baee144daaa1b41f6337effa870325 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2022-present HyperGH
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | 34.851064 | 120 | 0.690171 |
import os
import re
import types
from setuptools import find_namespace_packages
from setuptools import setup
name = "miru"
def parse_meta():
with open(os.path.join(name, "__init__.py")) as fp:
code = fp.read()
token_pattern = re.compile(r"^__(?P<key>\w+)?__\s*=\s*(?P<quote>(?:'{3}|\"{3}|'|\"))(?P<... | true | true |
1c2c1c7b3896f407d171c284c7c03dfea1455844 | 58,209 | py | Python | lte/gateway/python/integ_tests/s1aptests/s1ap_utils.py | ashish-acl/magma | d938f420b56b867a7c64101e6fac63f50be58a46 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/integ_tests/s1aptests/s1ap_utils.py | ashish-acl/magma | d938f420b56b867a7c64101e6fac63f50be58a46 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/integ_tests/s1aptests/s1ap_utils.py | ashish-acl/magma | d938f420b56b867a7c64101e6fac63f50be58a46 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 36.335206 | 125 | 0.530588 |
import ctypes
import ipaddress
import logging
import os
import shlex
import threading
import time
from enum import Enum
from queue import Queue
from typing import Optional
import grpc
import subprocess
import json
import s1ap_types
from integ_tests.gateway.rpc import get_rpc_channel
from lte.protos.policydb_pb2 impo... | true | true |
1c2c1d7890efc23e0bdea96dce3259aa992eba31 | 99,719 | py | Python | ai4water/preprocessing/datahandler.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 12 | 2020-10-13T08:23:17.000Z | 2021-01-22T04:36:21.000Z | ai4water/preprocessing/datahandler.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 1 | 2020-10-15T02:42:52.000Z | 2020-10-15T02:51:07.000Z | ai4water/preprocessing/datahandler.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 2 | 2020-11-23T04:45:38.000Z | 2020-11-26T10:12:34.000Z | import os
import copy
import json
import warnings
from typing import Union, Tuple
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from sklearn.model_selection import train_test_split
from sklearn.model_selection import KFold, LeaveOneOut, TimeSeriesSplit
from... | 38.74087 | 153 | 0.556444 | import os
import copy
import json
import warnings
from typing import Union, Tuple
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from sklearn.model_selection import train_test_split
from sklearn.model_selection import KFold, LeaveOneOut, TimeSeriesSplit
from... | true | true |
1c2c1ecd58a4917781ee5a0596ac3eb30799d735 | 485 | py | Python | Python/SimplifyPathTest.py | TonnyL/Windary | 39f85cdedaaf5b85f7ce842ecef975301fc974cf | [
"MIT"
] | 205 | 2017-11-16T08:38:46.000Z | 2022-03-06T05:50:03.000Z | Python/SimplifyPathTest.py | santosh241/Windary | 39f85cdedaaf5b85f7ce842ecef975301fc974cf | [
"MIT"
] | 3 | 2018-04-10T10:17:52.000Z | 2020-12-11T08:00:09.000Z | Python/SimplifyPathTest.py | santosh241/Windary | 39f85cdedaaf5b85f7ce842ecef975301fc974cf | [
"MIT"
] | 28 | 2018-04-10T06:42:42.000Z | 2021-09-14T14:15:39.000Z | from unittest import TestCase
from SimplifyPath import SimplifyPath
class TestSimplifyPath(TestCase):
def test_simplifyPath(self):
sp = SimplifyPath()
self.assertEqual(sp.simplifyPath("/home/"), "/home")
self.assertEqual(sp.simplifyPath("/a/./b/../../c/"), "/c")
self.assertEqua... | 25.526316 | 68 | 0.626804 | from unittest import TestCase
from SimplifyPath import SimplifyPath
class TestSimplifyPath(TestCase):
def test_simplifyPath(self):
sp = SimplifyPath()
self.assertEqual(sp.simplifyPath("/home/"), "/home")
self.assertEqual(sp.simplifyPath("/a/./b/../../c/"), "/c")
self.assertEqua... | true | true |
1c2c1ecff02208f628aa2e65eae53abaf0c94bd6 | 1,527 | py | Python | docs/conf.py | alexweav/nisystemlink-clients-python | f19a30907a7fef536043ecbddc5a755e5fedf846 | [
"MIT"
] | null | null | null | docs/conf.py | alexweav/nisystemlink-clients-python | f19a30907a7fef536043ecbddc5a755e5fedf846 | [
"MIT"
] | null | null | null | docs/conf.py | alexweav/nisystemlink-clients-python | f19a30907a7fef536043ecbddc5a755e5fedf846 | [
"MIT"
] | null | null | null | import os
import sys
sys.path.insert(0, os.path.abspath(".."))
# --------------------------------------------------------------------------------------
project = "nisystemlink"
copyright = "2020, National Instruments"
author = "National Instruments"
# The short X.Y version
version = "0.1"
# The full version, includ... | 26.789474 | 88 | 0.587426 | import os
import sys
sys.path.insert(0, os.path.abspath(".."))
project = "nisystemlink"
copyright = "2020, National Instruments"
author = "National Instruments"
version = "0.1"
release = "0.1.3"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_autodoc_type... | true | true |
1c2c1edc237faeeb210a95b60ce48beaa5f33843 | 3,010 | py | Python | tests/nlu/classifiers/test_embedding_intent_classifier.py | anil-slt/Rasa | 53685e85a3c9185f51e4f12cc055d2a65bb5314d | [
"Apache-2.0"
] | 4 | 2020-04-17T17:08:59.000Z | 2021-07-21T16:25:00.000Z | tests/nlu/classifiers/test_embedding_intent_classifier.py | anil-slt/Rasa | 53685e85a3c9185f51e4f12cc055d2a65bb5314d | [
"Apache-2.0"
] | 5 | 2020-04-10T09:08:46.000Z | 2021-08-25T14:40:03.000Z | tests/nlu/classifiers/test_embedding_intent_classifier.py | anil-slt/Rasa | 53685e85a3c9185f51e4f12cc055d2a65bb5314d | [
"Apache-2.0"
] | 2 | 2020-11-04T04:03:30.000Z | 2021-01-27T04:41:42.000Z | import numpy as np
import pytest
import scipy.sparse
from rasa.nlu.constants import (
TEXT_ATTRIBUTE,
SPARSE_FEATURE_NAMES,
DENSE_FEATURE_NAMES,
INTENT_ATTRIBUTE,
)
from rasa.nlu.classifiers.embedding_intent_classifier import EmbeddingIntentClassifier
from rasa.nlu.training_data import Message
def te... | 28.130841 | 86 | 0.498671 | import numpy as np
import pytest
import scipy.sparse
from rasa.nlu.constants import (
TEXT_ATTRIBUTE,
SPARSE_FEATURE_NAMES,
DENSE_FEATURE_NAMES,
INTENT_ATTRIBUTE,
)
from rasa.nlu.classifiers.embedding_intent_classifier import EmbeddingIntentClassifier
from rasa.nlu.training_data import Message
def te... | true | true |
1c2c1f26c46eb966c4b21455bbacceee4e343723 | 3,179 | py | Python | eth/beacon/_utils/random.py | Bhargavasomu/py-evm | ee8f72d5a70805575a967cde0a43942e1526264e | [
"MIT"
] | null | null | null | eth/beacon/_utils/random.py | Bhargavasomu/py-evm | ee8f72d5a70805575a967cde0a43942e1526264e | [
"MIT"
] | null | null | null | eth/beacon/_utils/random.py | Bhargavasomu/py-evm | ee8f72d5a70805575a967cde0a43942e1526264e | [
"MIT"
] | 2 | 2019-09-05T01:31:56.000Z | 2019-09-17T09:09:16.000Z |
from typing import (
Any,
Iterable,
Sequence,
Tuple,
TypeVar,
)
from eth_typing import (
Hash32,
)
from eth_utils import (
to_tuple,
)
from eth.beacon._utils.hash import (
hash_eth2,
)
from eth.beacon.constants import (
RAND_BYTES,
RAND_MAX,
)
TItem = TypeVar('TItem')
@to_... | 32.111111 | 156 | 0.612142 |
from typing import (
Any,
Iterable,
Sequence,
Tuple,
TypeVar,
)
from eth_typing import (
Hash32,
)
from eth_utils import (
to_tuple,
)
from eth.beacon._utils.hash import (
hash_eth2,
)
from eth.beacon.constants import (
RAND_BYTES,
RAND_MAX,
)
TItem = TypeVar('TItem')
@to_... | true | true |
1c2c1fae3f0888772ce80d4a08476f303b3afbcd | 1,697 | py | Python | app/notifications/notifications_email_callback.py | davidbgk/notification-api | 0ede6a61b48289236d1873124965d2bc22a9b27b | [
"MIT"
] | 1 | 2021-08-13T13:46:04.000Z | 2021-08-13T13:46:04.000Z | app/notifications/notifications_email_callback.py | davidbgk/notification-api | 0ede6a61b48289236d1873124965d2bc22a9b27b | [
"MIT"
] | null | null | null | app/notifications/notifications_email_callback.py | davidbgk/notification-api | 0ede6a61b48289236d1873124965d2bc22a9b27b | [
"MIT"
] | 1 | 2021-09-29T18:25:48.000Z | 2021-09-29T18:25:48.000Z | from datetime import datetime
from flask import Blueprint
from flask import current_app
from flask import json
from flask import request, jsonify
from app.errors import InvalidRequest, register_errors
from app.clients.email.sendgrid_client import get_sendgrid_responses
from app import statsd_client
from app.dao impor... | 36.891304 | 112 | 0.728344 | from datetime import datetime
from flask import Blueprint
from flask import current_app
from flask import json
from flask import request, jsonify
from app.errors import InvalidRequest, register_errors
from app.clients.email.sendgrid_client import get_sendgrid_responses
from app import statsd_client
from app.dao impor... | true | true |
1c2c1fba38356b075ac9c9a513394587f74d6627 | 952 | py | Python | var/spack/repos/builtin/packages/r-remotes/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/r-remotes/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/r-remotes/package.py | carlabguillen/spack | 7070bb892f9bdb5cf9e76e0eecd64f6cc5f4695c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRemotes(RPackage):
"""Download and install R packages stored in 'GitHub', 'BitBucket', or... | 41.391304 | 95 | 0.730042 |
from spack import *
class RRemotes(RPackage):
homepage = "https://github.com/r-lib/remotes#readme"
url = "https://cloud.r-project.org/src/contrib/remotes_2.1.0.tar.gz"
list_url = "https://cloud.r-project.org/src/contrib/Archive/remotes"
version('2.1.1', sha256='4e590746fce618094089372b185e1ea2... | true | true |
1c2c205102b642af21d582fa7a41363dad38b9ff | 3,851 | py | Python | tests/test_linalg/test_solvers/test_belief_updates/test_matrix_based/test_symmetric_matrix_based_linear_belief_update.py | NDOWAH/probnum | 91a5cf920fe0793d01f3d7dae4b3909c4a74d201 | [
"MIT"
] | 1 | 2021-06-22T14:25:43.000Z | 2021-06-22T14:25:43.000Z | tests/test_linalg/test_solvers/test_belief_updates/test_matrix_based/test_symmetric_matrix_based_linear_belief_update.py | pitmonticone/probnum | 1fed705b2443a14d08419e16f98f6ef815ae9ffa | [
"MIT"
] | 42 | 2021-03-08T07:20:40.000Z | 2022-03-28T05:04:48.000Z | tests/test_linalg/test_solvers/test_belief_updates/test_matrix_based/test_symmetric_matrix_based_linear_belief_update.py | pitmonticone/probnum | 1fed705b2443a14d08419e16f98f6ef815ae9ffa | [
"MIT"
] | null | null | null | """Tests for the symmetric matrix-based belief update for linear information."""
import pathlib
import numpy as np
import pytest
from pytest_cases import parametrize_with_cases
from probnum import linops, randvars
from probnum.linalg.solvers import LinearSolverState, belief_updates, beliefs
case_modules = (pathlib.... | 33.198276 | 93 | 0.719294 |
import pathlib
import numpy as np
import pytest
from pytest_cases import parametrize_with_cases
from probnum import linops, randvars
from probnum.linalg.solvers import LinearSolverState, belief_updates, beliefs
case_modules = (pathlib.Path(__file__).parent.parent / "cases").stem
cases_belief_updates = case_modules ... | true | true |
1c2c20ac8a769d65250428a6409c0ab27e840ff7 | 706 | py | Python | specs/default/cluster-init/tests/test_uid.py | hmeiland/cyclecloud-slurm | 2b5efb3dda92a8f58e4bc57f0b040eb5f77de30f | [
"MIT"
] | 1 | 2021-05-12T15:37:07.000Z | 2021-05-12T15:37:07.000Z | specs/default/cluster-init/tests/test_uid.py | hmeiland/cyclecloud-slurm | 2b5efb3dda92a8f58e4bc57f0b040eb5f77de30f | [
"MIT"
] | null | null | null | specs/default/cluster-init/tests/test_uid.py | hmeiland/cyclecloud-slurm | 2b5efb3dda92a8f58e4bc57f0b040eb5f77de30f | [
"MIT"
] | null | null | null | #!/opt/cycle/jetpack/system/embedded/bin/python -m pytest
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import subprocess
import jetpack.config
def test_slurm_uid():
suid = jetpack.config.get('slurm.user.uid').strip()
suser = jetpack.config.get('slurm.user.name'... | 37.157895 | 67 | 0.70255 | import subprocess
import jetpack.config
def test_slurm_uid():
suid = jetpack.config.get('slurm.user.uid').strip()
suser = jetpack.config.get('slurm.user.name').strip()
muid = jetpack.config.get('munge.user.uid').strip()
muser = jetpack.config.get('munge.user.name').strip()
subprocess.check_ca... | true | true |
1c2c20b962b505f8179a00c3b2d9fa46fae9ef17 | 7,819 | py | Python | wrfpy/utils.py | rvanharen/wrfpy | caa1159326abcc59e5e25921f5de72a274962275 | [
"Apache-2.0"
] | 11 | 2018-01-06T22:20:04.000Z | 2022-03-10T15:26:21.000Z | wrfpy/utils.py | ERA-URBAN/wrfpy | caa1159326abcc59e5e25921f5de72a274962275 | [
"Apache-2.0"
] | 14 | 2017-04-11T13:11:38.000Z | 2021-03-19T22:49:42.000Z | wrfpy/utils.py | rvanharen/wrfpy | caa1159326abcc59e5e25921f5de72a274962275 | [
"Apache-2.0"
] | 5 | 2017-06-13T12:17:54.000Z | 2021-09-26T02:44:52.000Z | #!/usr/bin/env python3
'''
description: Utilities used in wrfpy
license: APACHE 2.0
author: Ronald van Haren, NLeSC (r.vanharen@esciencecenter.nl)
'''
import logging
import sys
import os
# define global LOG variables
DEFAULT_LOG_LEVEL = 'debug'
LOG_LEVELS = {'debug': logging.DEBUG,
'i... | 28.959259 | 79 | 0.62783 |
import logging
import sys
import os
DEFAULT_LOG_LEVEL = 'debug'
LOG_LEVELS = {'debug': logging.DEBUG,
'info': logging.INFO,
'warning': logging.WARNING,
'error': logging.ERROR,
'critical': logging.CRITICAL}
LOG_LEVELS_LIST = LOG_LEVELS.keys()
LOG_FORMAT = '%(asc... | true | true |
1c2c21bf1d1f3f2b5b0226a69d6c7dc8f0d87e0a | 15,249 | py | Python | src/python/twitter/pants/binary_util.py | wfarner/commons | 42988a7a49f012665174538cca53604c7846ee86 | [
"Apache-2.0"
] | 1 | 2019-12-20T14:13:27.000Z | 2019-12-20T14:13:27.000Z | src/python/twitter/pants/binary_util.py | wfarner/commons | 42988a7a49f012665174538cca53604c7846ee86 | [
"Apache-2.0"
] | null | null | null | src/python/twitter/pants/binary_util.py | wfarner/commons | 42988a7a49f012665174538cca53604c7846ee86 | [
"Apache-2.0"
] | 1 | 2019-12-20T14:13:29.000Z | 2019-12-20T14:13:29.000Z | # ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 37.651852 | 100 | 0.66365 |
from __future__ import division, print_function
import os
import errno
import itertools
import posixpath
import subprocess
from contextlib import closing, contextmanager
from twitter.common import log
from twitter.common.contextutil import environment_as, temporary_file, temporary_dir
from twitter.common.dirutil im... | true | true |
1c2c2271471e2c0763c1446eef497c2efa5dc733 | 1,885 | py | Python | discrete_fuzzy_operators/base/operators/binary_operators/suboperators/fuzzy_aggregation_suboperators/nullnorm.py | mmunar97/discrete-fuzzy-operators | e97646faa82a732b7d24c2e6621704b981b80b60 | [
"MIT"
] | null | null | null | discrete_fuzzy_operators/base/operators/binary_operators/suboperators/fuzzy_aggregation_suboperators/nullnorm.py | mmunar97/discrete-fuzzy-operators | e97646faa82a732b7d24c2e6621704b981b80b60 | [
"MIT"
] | null | null | null | discrete_fuzzy_operators/base/operators/binary_operators/suboperators/fuzzy_aggregation_suboperators/nullnorm.py | mmunar97/discrete-fuzzy-operators | e97646faa82a732b7d24c2e6621704b981b80b60 | [
"MIT"
] | null | null | null | import numpy
from discrete_fuzzy_operators.base.operators.binary_operators.suboperators.fuzzy_aggregation_operator import \
DiscreteFuzzyAggregationBinaryOperator
from typing import Callable
class Nullnorm(DiscreteFuzzyAggregationBinaryOperator):
def __init__(self, n: int,
k: int,
... | 50.945946 | 118 | 0.661538 | import numpy
from discrete_fuzzy_operators.base.operators.binary_operators.suboperators.fuzzy_aggregation_operator import \
DiscreteFuzzyAggregationBinaryOperator
from typing import Callable
class Nullnorm(DiscreteFuzzyAggregationBinaryOperator):
def __init__(self, n: int,
k: int,
... | true | true |
1c2c240ba51aa9a5a97742a7d246ed58d9c144e7 | 1,582 | py | Python | src/test/task_scoring/tasks_tests_handler/previous_errors_test.py | JetBrains-Research/codetracker-data | 6fb3900bd3cfe44d900d7fa8e89c7c35818424ed | [
"MIT"
] | 4 | 2020-05-12T10:29:15.000Z | 2020-08-21T04:26:12.000Z | src/test/task_scoring/tasks_tests_handler/previous_errors_test.py | JetBrains-Research/task-tracker-post-processing | 6fb3900bd3cfe44d900d7fa8e89c7c35818424ed | [
"MIT"
] | 15 | 2020-02-05T12:18:00.000Z | 2020-05-08T09:22:50.000Z | src/test/task_scoring/tasks_tests_handler/previous_errors_test.py | JetBrains-Research/task-tracker-post-processing | 6fb3900bd3cfe44d900d7fa8e89c7c35818424ed | [
"MIT"
] | 1 | 2020-06-21T06:50:11.000Z | 2020-06-21T06:50:11.000Z | # Copyright (c) 2020 Anastasiia Birillo, Elena Lyulina
import os
import pytest
from src.main.util.consts import TEST_DATA_PATH, TASK
from src.main.util.language_util import get_language_by_extension
from src.main.task_scoring.tasks_tests_handler import create_in_and_out_dict, check_tasks, run_tests
from src.main.uti... | 49.4375 | 116 | 0.764223 |
import os
import pytest
from src.main.util.consts import TEST_DATA_PATH, TASK
from src.main.util.language_util import get_language_by_extension
from src.main.task_scoring.tasks_tests_handler import create_in_and_out_dict, check_tasks, run_tests
from src.main.util.file_util import get_all_file_system_items, get_exten... | true | true |
1c2c2424c796938fda7f59e099075098b3c146c7 | 7,492 | py | Python | test/unit/tasks/test_forecasting.py | bahia14/Fedot_Times_Series_Forecast | 995751068733541ba2f546065082709ce0fb63ae | [
"BSD-3-Clause"
] | null | null | null | test/unit/tasks/test_forecasting.py | bahia14/Fedot_Times_Series_Forecast | 995751068733541ba2f546065082709ce0fb63ae | [
"BSD-3-Clause"
] | null | null | null | test/unit/tasks/test_forecasting.py | bahia14/Fedot_Times_Series_Forecast | 995751068733541ba2f546065082709ce0fb63ae | [
"BSD-3-Clause"
] | null | null | null | from random import seed
import numpy as np
import pytest
from sklearn.metrics import mean_absolute_error, mean_squared_error
from statsmodels.tsa.arima_process import ArmaProcess
from fedot.core.data.data import InputData
from fedot.core.data.data_split import train_test_data_setup
from fedot.core.pipelines.node impo... | 34.366972 | 93 | 0.712493 | from random import seed
import numpy as np
import pytest
from sklearn.metrics import mean_absolute_error, mean_squared_error
from statsmodels.tsa.arima_process import ArmaProcess
from fedot.core.data.data import InputData
from fedot.core.data.data_split import train_test_data_setup
from fedot.core.pipelines.node impo... | true | true |
1c2c2446168078597ab5cdb68e8d9c24293893b6 | 881 | py | Python | atom/nucleus/python/test/test_card_details_vo.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_card_details_vo.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_card_details_vo.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Nucleus API
The Hydrogen Nucleus API # noqa: E501
OpenAPI spec version: 1.9.5
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import nucleus_api
from nu... | 21.487805 | 82 | 0.701476 |
from __future__ import absolute_import
import unittest
import nucleus_api
from nucleus_api.models.card_details_vo import CardDetailsVO from nucleus_api.rest import ApiException
class TestCardDetailsVO(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testCardD... | true | true |
1c2c24be7988d5e0d24c50cfd0f5ee10081a7573 | 665 | py | Python | day16/coffeeMachine/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day16/coffeeMachine/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | day16/coffeeMachine/main.py | nurmatthias/100DaysOfCode | 22002e4b31d13e6b52e6b9222d2e91c2070c5744 | [
"Apache-2.0"
] | null | null | null | from menu import Menu, MenuItem
from coffee_maker import CoffeeMaker
from money_machine import MoneyMachine
machine = CoffeeMaker()
moneyBox = MoneyMachine()
menu = Menu()
machine_running = True
while machine_running:
choice = input(f"Our menu: {menu.get_items()} \nWhat would you like? ").lower()
if choic... | 25.576923 | 87 | 0.666165 | from menu import Menu, MenuItem
from coffee_maker import CoffeeMaker
from money_machine import MoneyMachine
machine = CoffeeMaker()
moneyBox = MoneyMachine()
menu = Menu()
machine_running = True
while machine_running:
choice = input(f"Our menu: {menu.get_items()} \nWhat would you like? ").lower()
if choic... | true | true |
1c2c25bc1316e2704e991e848fb9a89dcf6f36b1 | 4,656 | py | Python | config_utils/re_train_deeplab_v3plus.py | charleshsc/autodeeplab | 03809e5aeb8fe7d570921b0265520e9fa976da88 | [
"MIT"
] | 90 | 2020-05-19T07:19:12.000Z | 2022-03-21T18:11:45.000Z | config_utils/re_train_deeplab_v3plus.py | hjl-yul154/autodeeplab | 1bd8399ac830fcafd506a4207b75e05682d1e260 | [
"MIT"
] | 17 | 2020-05-18T13:52:05.000Z | 2021-09-08T04:51:58.000Z | config_utils/re_train_deeplab_v3plus.py | hjl-yul154/autodeeplab | 1bd8399ac830fcafd506a4207b75e05682d1e260 | [
"MIT"
] | 28 | 2020-06-14T22:30:35.000Z | 2022-02-23T12:17:42.000Z | import argparse
def obtain_retrain_deeplab_v3plus_args():
parser = argparse.ArgumentParser(description="PyTorch DeeplabV3Plus Training")
parser.add_argument('--backbone', type=str, default='resnet',
choices=['resnet', 'xception', 'drn', 'mobilenet'],
help='backb... | 58.936709 | 94 | 0.577964 | import argparse
def obtain_retrain_deeplab_v3plus_args():
parser = argparse.ArgumentParser(description="PyTorch DeeplabV3Plus Training")
parser.add_argument('--backbone', type=str, default='resnet',
choices=['resnet', 'xception', 'drn', 'mobilenet'],
help='backb... | true | true |
1c2c26bb3d367a174b0673cc8756efbe51e0ec91 | 2,329 | py | Python | tfx/extensions/google_cloud_ai_platform/tuner/component_test.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 1,813 | 2019-02-04T17:17:30.000Z | 2022-03-29T13:39:30.000Z | tfx/extensions/google_cloud_ai_platform/tuner/component_test.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 2,710 | 2019-02-14T00:41:00.000Z | 2022-03-31T07:23:00.000Z | tfx/extensions/google_cloud_ai_platform/tuner/component_test.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 731 | 2019-02-04T17:59:18.000Z | 2022-03-31T06:45:51.000Z | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.761194 | 77 | 0.731215 |
import tensorflow as tf
from tfx.extensions.google_cloud_ai_platform.tuner import component
from tfx.proto import trainer_pb2
from tfx.proto import tuner_pb2
from tfx.types import channel_utils
from tfx.types import standard_artifacts
class TunerTest(tf.test.TestCase):
def setUp(self):
super().setUp()
sel... | true | true |
1c2c2728763b798c6f57925fcb7432baa6f7fd51 | 9,048 | py | Python | idea/migrations/0019_auto__add_field_banner_slug__add_field_banner_private__chg_field_vote_.py | mikiec84/idea-box | 02df9e5130ab4d463ad7f43f7a4a3a51dc640840 | [
"CC0-1.0"
] | 111 | 2015-01-05T21:15:31.000Z | 2021-08-18T18:07:53.000Z | idea/migrations/0019_auto__add_field_banner_slug__add_field_banner_private__chg_field_vote_.py | mikiec84/idea-box | 02df9e5130ab4d463ad7f43f7a4a3a51dc640840 | [
"CC0-1.0"
] | 30 | 2015-02-11T21:09:49.000Z | 2022-03-11T23:26:07.000Z | idea/migrations/0019_auto__add_field_banner_slug__add_field_banner_private__chg_field_vote_.py | gaybro8777/idea-box | 02df9e5130ab4d463ad7f43f7a4a3a51dc640840 | [
"CC0-1.0"
] | 39 | 2015-01-06T07:41:49.000Z | 2022-02-24T14:03:04.000Z | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Banner.slug', unique=False for now to prevent duplicate key errors
db.add_column(u'idea_bann... | 68.545455 | 217 | 0.556698 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'idea_banner', 'slug',
self.gf('django.db.models.fields.SlugField')(default='', unique=False, m... | true | true |
1c2c2763a791d54ccbcb6ac7a676edd5885da2ed | 47,092 | py | Python | course/utils.py | hanjianwei/relate | 971e27a1bdd69236dc6dc294024b50584435a18d | [
"Unlicense"
] | null | null | null | course/utils.py | hanjianwei/relate | 971e27a1bdd69236dc6dc294024b50584435a18d | [
"Unlicense"
] | 6 | 2015-08-18T00:13:40.000Z | 2018-01-31T05:55:13.000Z | course/utils.py | dzhuang/relate | f90cc146861e1523f50d29fa1e90ded32e351428 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division
__copyright__ = "Copyright (C) 2014 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restricti... | 34.298616 | 104 | 0.616347 |
from __future__ import division
__copyright__ = "Copyright (C) 2014 Andreas Kloeckner"
__license__ = """
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without li... | true | true |
1c2c2abc292e094c964304994a04f514ca6a06e2 | 11,092 | py | Python | deslib/des/knop.py | hossen-code/DESlib | 77d0ccb491c522e7505d9ac6081b72cac001cb9e | [
"BSD-3-Clause"
] | 149 | 2018-01-18T08:35:07.000Z | 2021-11-11T19:43:40.000Z | deslib/des/knop.py | hossen-code/DESlib | 77d0ccb491c522e7505d9ac6081b72cac001cb9e | [
"BSD-3-Clause"
] | 90 | 2018-01-18T22:18:58.000Z | 2020-02-08T04:39:36.000Z | deslib/des/knop.py | hossen-code/DESlib | 77d0ccb491c522e7505d9ac6081b72cac001cb9e | [
"BSD-3-Clause"
] | 49 | 2018-01-17T21:28:06.000Z | 2021-02-04T21:56:13.000Z | # coding=utf-8
# Author: Rafael Menelau Oliveira e Cruz <rafaelmenelau@gmail.com>
#
# License: BSD 3 clause
import numpy as np
from deslib.des.base import BaseDES
class KNOP(BaseDES):
"""k-Nearest Output Profiles (KNOP).
This method selects all classifiers that correctly classified at least
one sample... | 39.47331 | 79 | 0.617652 |
import numpy as np
from deslib.des.base import BaseDES
class KNOP(BaseDES):
def __init__(self, pool_classifiers=None, k=7, DFP=False, with_IH=False,
safe_k=None,
IH_rate=0.30, random_state=None, knn_classifier='knn',
knne=False,
DSEL_perc=0.5)... | true | true |
1c2c2adca765359b609e0eae49e49254f7d6d57d | 4,258 | py | Python | .history/src/Simulador_20200707150756.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200707150756.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200707150756.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo
import random
class Simulador():
def __init__(
self,
tamanho_matriz, #numero de linhas e colunas da matriz esférica
densidade_populacional_inicial, #percentual... | 32.257576 | 115 | 0.61038 | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo
import random
class Simulador():
def __init__(
self,
tamanho_matriz, densidade_populacional_inicial, percentual_inicial_tipo1, percentual... | true | true |
1c2c2b2f401390f97d3f410f2ad9b8f7c67bcfea | 1,007 | py | Python | convert_codes.py | rhoposit/sentencepiece | ae818bca6ecd73c2dde63ee5b84950352a136a2e | [
"Apache-2.0"
] | null | null | null | convert_codes.py | rhoposit/sentencepiece | ae818bca6ecd73c2dde63ee5b84950352a136a2e | [
"Apache-2.0"
] | null | null | null | convert_codes.py | rhoposit/sentencepiece | ae818bca6ecd73c2dde63ee5b84950352a136a2e | [
"Apache-2.0"
] | null | null | null | import sys
from collections import defaultdict
infile = sys.argv[1]
outfile = sys.argv[2]
refile = "topokanji/lists/wikipedia.txt"
input = open(infile, "r")
data = input.read().split("\n")[:-1]
input.close()
input = open(refile, "r")
kanji = input.read().split("\n")[:-1]
input.close()
mapping = defaultdict(str)... | 19.365385 | 43 | 0.559086 | import sys
from collections import defaultdict
infile = sys.argv[1]
outfile = sys.argv[2]
refile = "topokanji/lists/wikipedia.txt"
input = open(infile, "r")
data = input.read().split("\n")[:-1]
input.close()
input = open(refile, "r")
kanji = input.read().split("\n")[:-1]
input.close()
mapping = defaultdict(str)... | true | true |
1c2c2c09db0e78f1effee834c48a644cedbb7993 | 2,802 | py | Python | src/hard/continuous_median.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | src/hard/continuous_median.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | src/hard/continuous_median.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | """
Continuous Median: Numbers are randomly generated and passed to a method. Write a program
to find and maintain the median value as new values are generated.
median is the 50th percentil
3 7 2 9 2 1
sort and get the element in the middle
either keep a sorted list and insert sorted (O(n))
Another approach is to... | 26.433962 | 89 | 0.717345 | import collections
import heapq
from typing import List
Value = collections.namedtuple('Value', 'indexing val')
class MedianHandler:
def __init__(self) -> None:
self.min_heap: List[Value] = []
self.max_heap: List[Value] = []
def insert(self, number: int) -> None:
target_heap: str = self.find_heap_to_inser... | true | true |
1c2c2ce9673a9c978a1ab6e29b493c8185ce9a69 | 2,228 | py | Python | tests/algorithms/graph/dijkstras_test.py | TylerYep/workshop | 69b19afc81c1b84b7f60723077670fb789b55744 | [
"MIT"
] | 1 | 2021-06-14T01:20:09.000Z | 2021-06-14T01:20:09.000Z | tests/algorithms/graph/dijkstras_test.py | TylerYep/workshop | 69b19afc81c1b84b7f60723077670fb789b55744 | [
"MIT"
] | null | null | null | tests/algorithms/graph/dijkstras_test.py | TylerYep/workshop | 69b19afc81c1b84b7f60723077670fb789b55744 | [
"MIT"
] | null | null | null | from typing import Any
import pytest
from cs.algorithms import dijkstra_search, dijkstra_shortest_paths
from cs.structures import Graph
from tests.algorithms.graph.problems.apsp import AllPairsShortestPaths, APSPFunction
@pytest.mark.add_function("shortest_paths_fn")
class TestDijkstras(AllPairsShortestPaths):
... | 28.202532 | 84 | 0.406643 | from typing import Any
import pytest
from cs.algorithms import dijkstra_search, dijkstra_shortest_paths
from cs.structures import Graph
from tests.algorithms.graph.problems.apsp import AllPairsShortestPaths, APSPFunction
@pytest.mark.add_function("shortest_paths_fn")
class TestDijkstras(AllPairsShortestPaths):
... | true | true |
1c2c2d60ce873022688a95ab211893f36a8cabdf | 1,657 | py | Python | test/test_db_matches_ui.py | Elen-T/python_training | 69383759e4229441657bd57af28a7a38b04d026d | [
"Apache-2.0"
] | null | null | null | test/test_db_matches_ui.py | Elen-T/python_training | 69383759e4229441657bd57af28a7a38b04d026d | [
"Apache-2.0"
] | null | null | null | test/test_db_matches_ui.py | Elen-T/python_training | 69383759e4229441657bd57af28a7a38b04d026d | [
"Apache-2.0"
] | null | null | null | # тест для проверки соответствия списка групп выгруженного из БД и из приложения
from model.group import Group
from timeit import timeit # для измерения времени
def test_group_list(app, db): # передаем два параметра app - для получения доступа к приложению, db - фикстура для получения доступа к бд
print(timeit(l... | 78.904762 | 183 | 0.76041 | from model.group import Group
from timeit import timeit
def test_group_list(app, db): print(timeit(lambda: app.group.get_group_list(), number=1)) def clean(group): return Group(id=group.id, name=group.name.strip())
print(timeit(lambda: map(clean, db.get_group_list()), number=1000))
| true | true |
1c2c2e831b629332f9d2f535a5e165b805911787 | 436 | py | Python | babyrev/test.py | FantasqueX/2020p | fd6df5ad8bced932398c94dd8a0b4669f5db8d4c | [
"MIT"
] | 22 | 2020-12-20T08:01:00.000Z | 2021-09-13T04:53:34.000Z | babyrev/test.py | FantasqueX/2020p | fd6df5ad8bced932398c94dd8a0b4669f5db8d4c | [
"MIT"
] | 2 | 2020-12-20T11:39:17.000Z | 2021-07-05T17:33:52.000Z | babyrev/test.py | FantasqueX/2020p | fd6df5ad8bced932398c94dd8a0b4669f5db8d4c | [
"MIT"
] | 4 | 2020-12-20T13:22:29.000Z | 2021-09-13T04:54:16.000Z | import requests
def check(HOST="172.17.0.2"):
def pre():
if b"we{" in (requests.get(f"http://{HOST}/").content):
print("Flag appear directly")
else:
print("OK")
def get_flag():
if b"we{" not in (requests.get(f"http://{HOST}/", headers={
"User-Agent"... | 24.222222 | 67 | 0.486239 | import requests
def check(HOST="172.17.0.2"):
def pre():
if b"we{" in (requests.get(f"http://{HOST}/").content):
print("Flag appear directly")
else:
print("OK")
def get_flag():
if b"we{" not in (requests.get(f"http://{HOST}/", headers={
"User-Agent"... | true | true |
1c2c31397ee9e10bde8f40a3b4a3bde328a8df0c | 162 | py | Python | reid/scripts/triplet_reid/__init__.py | VisualComputingInstitute/CROWDBOT_perception | df98f3f658c39fb3fa4ac0456f1214f7918009f6 | [
"MIT"
] | 1 | 2022-03-07T06:24:27.000Z | 2022-03-07T06:24:27.000Z | reid/scripts/triplet_reid/__init__.py | VisualComputingInstitute/CROWDBOT_perception | df98f3f658c39fb3fa4ac0456f1214f7918009f6 | [
"MIT"
] | null | null | null | reid/scripts/triplet_reid/__init__.py | VisualComputingInstitute/CROWDBOT_perception | df98f3f658c39fb3fa4ac0456f1214f7918009f6 | [
"MIT"
] | null | null | null | from importlib import import_module
def build_cfg_fn(name):
module = import_module('schedulers.scheduler')
return getattr(module, '{}_cfg'.format(name))
| 27 | 50 | 0.753086 | from importlib import import_module
def build_cfg_fn(name):
module = import_module('schedulers.scheduler')
return getattr(module, '{}_cfg'.format(name))
| true | true |
1c2c31e005ccedfb263e13c84488b2699bfca794 | 9,698 | py | Python | jax/experimental/ode.py | yurodiviy/jax | fbf10c697004327e13037e009612b756864d47e5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/experimental/ode.py | yurodiviy/jax | fbf10c697004327e13037e009612b756864d47e5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/experimental/ode.py | yurodiviy/jax | fbf10c697004327e13037e009612b756864d47e5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.104839 | 84 | 0.646216 |
from functools import partial
import operator as op
import jax
import jax.numpy as jnp
from jax import core
from jax import lax
from jax import ops
from jax.util import safe_map, safe_zip
from jax.flatten_util import ravel_pytree
from jax.tree_util import tree_map
from jax import linear_util as lu
map = safe_map
z... | true | true |
1c2c324d027847f578914ab7ae65bf477ce41dfc | 57,707 | py | Python | Tests/otlLib/builder_test.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | null | null | null | Tests/otlLib/builder_test.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | 1 | 2015-11-30T17:47:38.000Z | 2015-11-30T17:47:38.000Z | Tests/otlLib/builder_test.py | odidev/fonttools | 27b5f568f562971d7fbf64eeb027ea61e4939db4 | [
"Apache-2.0",
"MIT"
] | null | null | null | import io
import struct
from fontTools.misc.fixedTools import floatToFixed
from fontTools.misc.testTools import getXML
from fontTools.otlLib import builder, error
from fontTools import ttLib
from fontTools.ttLib.tables import otTables
import pytest
class BuilderTest(object):
GLYPHS = (
".notdef space zero... | 39.336742 | 104 | 0.451158 | import io
import struct
from fontTools.misc.fixedTools import floatToFixed
from fontTools.misc.testTools import getXML
from fontTools.otlLib import builder, error
from fontTools import ttLib
from fontTools.ttLib.tables import otTables
import pytest
class BuilderTest(object):
GLYPHS = (
".notdef space zero... | true | true |
1c2c33b94326f7fadbce2d5da8d21dea6a03aecb | 29,473 | py | Python | io_scene_gmdc/export_gmdc.py | actioninja/blender-gmdc | 2de19b9f50efea8ce794f928d06cb1660f2c576d | [
"MIT"
] | null | null | null | io_scene_gmdc/export_gmdc.py | actioninja/blender-gmdc | 2de19b9f50efea8ce794f928d06cb1660f2c576d | [
"MIT"
] | null | null | null | io_scene_gmdc/export_gmdc.py | actioninja/blender-gmdc | 2de19b9f50efea8ce794f928d06cb1660f2c576d | [
"MIT"
] | null | null | null | #!BPY
"""
Name: 'GMDC (.gmdc)'
Blender: 249
Group: 'Export'
Tooltip: 'Export to TS2 GMDC file' """
# -------------------------------------------------------------------------------
# Copyright (C) 2016 DjAlex88 (https://github.com/djalex88/)
#
# Permission is hereby granted, free of charge, to any person obtaining a... | 35.212664 | 138 | 0.506022 |
import os
from struct import pack
from io_scene_gmdc.gmdc_tools import *
from itertools import count, repeat
import bpy
from mathutils import Vector as BlenderVector
def prepare_geometry(settings):
scene = bpy.data.scenes.active
objects = filter(lambda obj: obj.type == 'Mesh', scene.objects)
... | true | true |
1c2c341372f9515eb232275aba6071181a5e278b | 24,349 | py | Python | evaluation/semantic_segmentation/mmcv_custom/checkpoint.py | taokong/ibot | a2ee1ae7495d4ea8fb9ba100434c062f1bd3d1f0 | [
"Apache-2.0"
] | 327 | 2021-12-09T10:03:55.000Z | 2022-03-31T12:26:22.000Z | evaluation/semantic_segmentation/mmcv_custom/checkpoint.py | taokong/ibot | a2ee1ae7495d4ea8fb9ba100434c062f1bd3d1f0 | [
"Apache-2.0"
] | 11 | 2021-12-30T11:39:43.000Z | 2022-03-28T05:40:48.000Z | evaluation/semantic_segmentation/mmcv_custom/checkpoint.py | taokong/ibot | a2ee1ae7495d4ea8fb9ba100434c062f1bd3d1f0 | [
"Apache-2.0"
] | 43 | 2021-12-09T10:48:26.000Z | 2022-03-29T06:58:40.000Z | # Copyright (c) ByteDance, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Copy-paste from mmcv library:
https://github.com/open-mmlab/mmcv/
"""
import io
import os
import os.path as osp
impor... | 39.020833 | 117 | 0.630293 |
import io
import os
import os.path as osp
import pkgutil
import time
import warnings
import mmcv
import torch
import torchvision
import numpy as np
import math
from collections import OrderedDict
from importlib import import_module
from tempfile import TemporaryDirectory
from torch.optim import Optimizer
from torch.... | true | true |
1c2c3457b127439091e661d78762077ed473ac78 | 2,017 | py | Python | tests/test_dict.py | potipot/Montreal-Forced-Aligner | 6d665e9c63a4e3c795d27ec3bb8d9d1a5604bb91 | [
"MIT"
] | null | null | null | tests/test_dict.py | potipot/Montreal-Forced-Aligner | 6d665e9c63a4e3c795d27ec3bb8d9d1a5604bb91 | [
"MIT"
] | null | null | null | tests/test_dict.py | potipot/Montreal-Forced-Aligner | 6d665e9c63a4e3c795d27ec3bb8d9d1a5604bb91 | [
"MIT"
] | null | null | null | import os
import pytest
from montreal_forced_aligner.dictionary import Dictionary
def ListLines(path):
lines = []
thefile = open(path)
text = thefile.readlines()
for line in text:
stripped = line.strip()
if stripped != '':
lines.append(stripped)
return lines
def test... | 39.54902 | 106 | 0.636589 | import os
import pytest
from montreal_forced_aligner.dictionary import Dictionary
def ListLines(path):
lines = []
thefile = open(path)
text = thefile.readlines()
for line in text:
stripped = line.strip()
if stripped != '':
lines.append(stripped)
return lines
def test... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.