hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f751a33d356f2cbc344675eceee311c8b24dce1c | 2,993 | py | Python | src/proximityGraph.py | geenasmith/WordAndSymbolSpotting | a05aeb65b40526b075f60a5887164b0db0c90cb8 | [
"MIT"
] | 1 | 2022-01-11T14:55:25.000Z | 2022-01-11T14:55:25.000Z | src/proximityGraph.py | geenasmith/WordAndSymbolSpotting | a05aeb65b40526b075f60a5887164b0db0c90cb8 | [
"MIT"
] | 1 | 2021-10-12T22:53:24.000Z | 2021-10-12T22:53:24.000Z | src/proximityGraph.py | geenasmith/WordAndSymbolSpotting | a05aeb65b40526b075f60a5887164b0db0c90cb8 | [
"MIT"
] | null | null | null | import networkx as nx
import math
import matplotlib.pyplot as plt
import numpy as np
def create_prox_graphs(kps, descs, k=5):
"""
Function which creates a proximity graph given a set of points.
:param kps: list containing sets of keypoints
:param descs: list containing sets of descriptors
:param ... | 35.211765 | 109 | 0.594387 | import networkx as nx
import math
import matplotlib.pyplot as plt
import numpy as np
def create_prox_graphs(kps, descs, k=5):
prox_graphs = []
for img in range(len(kps)):
g_data = nx.Graph()
g_prox = nx.Graph()
for i in range(len(kps[img])):
g_data.add_node(i,... | true | true |
f751a3b614326a056bf094b056d37bfb9a741694 | 5,691 | py | Python | listener.py | yezz123/spy | dea0f632981effff1a0c9a3e5db9372ee8d28c6a | [
"MIT"
] | 21 | 2020-06-18T04:07:58.000Z | 2022-01-23T17:05:36.000Z | listener.py | yezz123/spy | dea0f632981effff1a0c9a3e5db9372ee8d28c6a | [
"MIT"
] | null | null | null | listener.py | yezz123/spy | dea0f632981effff1a0c9a3e5db9372ee8d28c6a | [
"MIT"
] | 4 | 2020-10-16T14:10:04.000Z | 2021-11-15T04:04:53.000Z | # !}============================================================================{!
# !} Author: Yezz123 {!
# !} Instagram : https://www.instagram.com/sadnessvibewithbadeffect {!
# !} write with : Python. ... | 36.018987 | 84 | 0.369004 |
import socket
import os,sys,select,time
print """
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
____________ ___.__.
/ ___/\____ < | |
\___ \ | |_> >___ |
/____ >| __// ____|
\/ |__| \/ ... | false | true |
f751a3c00300e1341416350849a7a7836155bbd6 | 5,662 | py | Python | back-end data/api/utility/Qua_assisFunc.py | shaoyu0966/dorm-alloc-sys | 2b3772fafe663d30f21364008f7b2d52a9539d8f | [
"Apache-2.0"
] | null | null | null | back-end data/api/utility/Qua_assisFunc.py | shaoyu0966/dorm-alloc-sys | 2b3772fafe663d30f21364008f7b2d52a9539d8f | [
"Apache-2.0"
] | null | null | null | back-end data/api/utility/Qua_assisFunc.py | shaoyu0966/dorm-alloc-sys | 2b3772fafe663d30f21364008f7b2d52a9539d8f | [
"Apache-2.0"
] | null | null | null | from .static.Qua_config import *
from random import sample
from jieba import cut_for_search, cut
from nltk import bigrams, word_tokenize
import nltk
# assistant func
def countBedNum(DormList):
BedNum = {'男性':0,'女性':0}
for index, row in DormList.iterrows():
if('男' in row['dormName'] and row['is_disabi... | 34.950617 | 156 | 0.551572 | from .static.Qua_config import *
from random import sample
from jieba import cut_for_search, cut
from nltk import bigrams, word_tokenize
import nltk
def countBedNum(DormList):
BedNum = {'男性':0,'女性':0}
for index, row in DormList.iterrows():
if('男' in row['dormName'] and row['is_disability']==0):
... | true | true |
f751a3c195c525ab2f454d49a05098c3c8941155 | 1,188 | py | Python | scripts/draw_points.py | Kitware/VisCL | 6bfd860aea431bf3a4409921d53294c30c12b8c1 | [
"BSD-3-Clause"
] | 14 | 2015-05-03T05:17:56.000Z | 2020-05-26T04:12:32.000Z | scripts/draw_points.py | Kitware/VisCL | 6bfd860aea431bf3a4409921d53294c30c12b8c1 | [
"BSD-3-Clause"
] | null | null | null | scripts/draw_points.py | Kitware/VisCL | 6bfd860aea431bf3a4409921d53294c30c12b8c1 | [
"BSD-3-Clause"
] | 15 | 2016-01-17T02:26:57.000Z | 2020-03-29T16:18:04.000Z | #!/usr/bin/python
from optparse import OptionParser
import Image
import numpy as np
import matplotlib.pyplot as plt
def load_image(fname):
"""Load an image file"""
return np.array(Image.open(fname))
def load_points(fname):
"""Load a text file with 2D points.
The file should contain X and Y locatio... | 20.482759 | 72 | 0.617003 |
from optparse import OptionParser
import Image
import numpy as np
import matplotlib.pyplot as plt
def load_image(fname):
"""Load an image file"""
return np.array(Image.open(fname))
def load_points(fname):
"""Load a text file with 2D points.
The file should contain X and Y location of each point on... | false | true |
f751a485923b7dae85bbc0946cbbbc3e30a8a262 | 22,821 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_virtual_network_peerings_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_virtual_network_peerings_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_08_01/aio/operations/_virtual_network_peerings_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 52.826389 | 250 | 0.687481 | from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
f751a54cfa21886ce743faeb8aa663fef57b3dee | 1,440 | py | Python | ecommerce/migrations/0002_category_product.py | tavoxr/ecommerce_django_postgresql | 352fbe7714ec5d62ed9187642237b79d89421631 | [
"MIT"
] | null | null | null | ecommerce/migrations/0002_category_product.py | tavoxr/ecommerce_django_postgresql | 352fbe7714ec5d62ed9187642237b79d89421631 | [
"MIT"
] | null | null | null | ecommerce/migrations/0002_category_product.py | tavoxr/ecommerce_django_postgresql | 352fbe7714ec5d62ed9187642237b79d89421631 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.6 on 2021-08-08 11:31
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ecommerce', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Category',
... | 41.142857 | 142 | 0.597917 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ecommerce', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
('id', models.BigAu... | true | true |
f751a5e2740fe0ae4f5b6e0b4ad4a4257d29e8b6 | 2,060 | py | Python | tests/physics/sphere_63_120_nomass/averages.py | zzalscv2/FFEA | da8a09dadb1b3978a3d230dc79d9b163d7889242 | [
"Apache-2.0"
] | null | null | null | tests/physics/sphere_63_120_nomass/averages.py | zzalscv2/FFEA | da8a09dadb1b3978a3d230dc79d9b163d7889242 | [
"Apache-2.0"
] | null | null | null | tests/physics/sphere_63_120_nomass/averages.py | zzalscv2/FFEA | da8a09dadb1b3978a3d230dc79d9b163d7889242 | [
"Apache-2.0"
] | 1 | 2021-04-03T16:08:21.000Z | 2021-04-03T16:08:21.000Z | #
# This file is part of the FFEA simulation package
#
# Copyright (c) by the Theory and Development FFEA teams,
# as they appear in the README.md file.
#
# FFEA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software ... | 26.410256 | 84 | 0.619417 |
import numpy as np
import sys
def readAndAverage(iFile, ini, end, th, Fields):
H = []
A = {}
with open(iFile, 'r') as sta:
while (sta.readline() != "Measurements:\n"):
continue
for i in sta.readline().split():
H.append([i.strip()])
for line in sta:
cnt = 0
if line.count(... | false | true |
f751a79459d899bb39dff8beedf47f689e75b2aa | 52 | py | Python | artifact/stats/__init__.py | jtpaasch/artifact | 52d171c37935999af63f1e77f8455e11da1605a5 | [
"MIT"
] | null | null | null | artifact/stats/__init__.py | jtpaasch/artifact | 52d171c37935999af63f1e77f8455e11da1605a5 | [
"MIT"
] | null | null | null | artifact/stats/__init__.py | jtpaasch/artifact | 52d171c37935999af63f1e77f8455e11da1605a5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""A ``stats`` package."""
| 13 | 26 | 0.442308 | true | true | |
f751a84710bd4b174944c46d703a7d7f8b130c7d | 8,167 | py | Python | resqpy/organize/horizon_interpretation.py | poc11/resqpy | 5dfbfb924f8ee9b2712fb8e38bff96ee8ee9d8e2 | [
"MIT"
] | null | null | null | resqpy/organize/horizon_interpretation.py | poc11/resqpy | 5dfbfb924f8ee9b2712fb8e38bff96ee8ee9d8e2 | [
"MIT"
] | null | null | null | resqpy/organize/horizon_interpretation.py | poc11/resqpy | 5dfbfb924f8ee9b2712fb8e38bff96ee8ee9d8e2 | [
"MIT"
] | null | null | null | """Class for RESQML Horizon Interpretation organizational objects."""
from ._utils import (equivalent_extra_metadata, alias_for_attribute, extract_has_occurred_during,
equivalent_chrono_pairs, create_xml_has_occurred_during)
import resqpy.olio.uuid as bu
import resqpy.olio.xml_et as rqet
from res... | 52.690323 | 126 | 0.64577 |
from ._utils import (equivalent_extra_metadata, alias_for_attribute, extract_has_occurred_during,
equivalent_chrono_pairs, create_xml_has_occurred_during)
import resqpy.olio.uuid as bu
import resqpy.olio.xml_et as rqet
from resqpy.olio.base import BaseResqpy
from resqpy.olio.xml_namespaces import... | true | true |
f751a8b2e38a4352902f20b01c11c763e6893fc5 | 55,565 | py | Python | manim/scene/scene.py | rli596/manim | e147a9fc6c117332221e42437481f3efba76499a | [
"MIT"
] | 1 | 2022-03-07T10:22:13.000Z | 2022-03-07T10:22:13.000Z | manim/scene/scene.py | rli596/manim | e147a9fc6c117332221e42437481f3efba76499a | [
"MIT"
] | 21 | 2022-03-02T15:25:49.000Z | 2022-03-07T11:15:45.000Z | manim/scene/scene.py | DD2480-Group-10/manim | e147a9fc6c117332221e42437481f3efba76499a | [
"MIT"
] | null | null | null | """Basic canvas for animations."""
from __future__ import annotations
__all__ = ["Scene"]
import copy
import datetime
import inspect
import platform
import random
import threading
import time
import types
from queue import Queue
from typing import Callable
import srt
from manim.scene.section import DefaultSectionT... | 35.078914 | 159 | 0.579447 |
from __future__ import annotations
__all__ = ["Scene"]
import copy
import datetime
import inspect
import platform
import random
import threading
import time
import types
from queue import Queue
from typing import Callable
import srt
from manim.scene.section import DefaultSectionType
try:
import dearpygui.dear... | true | true |
f751a8ca3e0b1406af98f3c72e38ea805c79c019 | 20,412 | py | Python | numpy/distutils/exec_command.py | MichaelAquilina/numpy | 6e8b869d52ec5a1242df69bcd9323a4b0947933b | [
"BSD-3-Clause"
] | 1 | 2021-01-06T21:28:45.000Z | 2021-01-06T21:28:45.000Z | numpy/distutils/exec_command.py | MichaelAquilina/numpy | 6e8b869d52ec5a1242df69bcd9323a4b0947933b | [
"BSD-3-Clause"
] | null | null | null | numpy/distutils/exec_command.py | MichaelAquilina/numpy | 6e8b869d52ec5a1242df69bcd9323a4b0947933b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""
exec_command
Implements exec_command function that is (almost) equivalent to
commands.getstatusoutput function but on NT, DOS systems the
returned status is actually correct (though, the returned status
values may be different by a factor). In addition, exec_command
takes keyword arguments fo... | 31.403077 | 125 | 0.550167 | from __future__ import division, absolute_import, print_function
__all__ = ['exec_command', 'find_executable']
import os
import sys
import shlex
from numpy.distutils.misc_util import is_sequence, make_temp_file
from numpy.distutils import log
from numpy.distutils.compat import get_exception
from numpy.compat import... | true | true |
f751a95a5f3bf6c949b19a5402cbdac8bab6aa8c | 3,745 | py | Python | tests/snippets/builtin_complex.py | ypyf/RustPython | 86103bfd0187a6073cab91142f698cb6b0a0de51 | [
"MIT"
] | 1 | 2021-09-03T15:59:36.000Z | 2021-09-03T15:59:36.000Z | tests/snippets/builtin_complex.py | ypyf/RustPython | 86103bfd0187a6073cab91142f698cb6b0a0de51 | [
"MIT"
] | null | null | null | tests/snippets/builtin_complex.py | ypyf/RustPython | 86103bfd0187a6073cab91142f698cb6b0a0de51 | [
"MIT"
] | null | null | null | from testutils import assert_raises
# __abs__
assert abs(complex(3, 4)) == 5
assert abs(complex(3, -4)) == 5
assert abs(complex(1.5, 2.5)) == 2.9154759474226504
# __eq__
assert complex(1, -1) == complex(1, -1)
assert complex(1, 0) == 1
assert 1 == complex(1, 0)
assert complex(1, 1) != 1
assert 1 != complex(1, 1)
as... | 24.801325 | 65 | 0.633378 | from testutils import assert_raises
assert abs(complex(3, 4)) == 5
assert abs(complex(3, -4)) == 5
assert abs(complex(1.5, 2.5)) == 2.9154759474226504
assert complex(1, -1) == complex(1, -1)
assert complex(1, 0) == 1
assert 1 == complex(1, 0)
assert complex(1, 1) != 1
assert 1 != complex(1, 1)
assert complex(1, 0) ... | true | true |
f751a98a311641bee8c88f2000884cfea44fe187 | 5,408 | py | Python | users/tests/tests.py | Flict-dev/Boxes-api | a2aa76b2db6aaa5af1028138566dc3b2b251fcdb | [
"MIT"
] | 1 | 2021-12-13T22:03:58.000Z | 2021-12-13T22:03:58.000Z | users/tests/tests.py | Flict-dev/Boxes-api | a2aa76b2db6aaa5af1028138566dc3b2b251fcdb | [
"MIT"
] | null | null | null | users/tests/tests.py | Flict-dev/Boxes-api | a2aa76b2db6aaa5af1028138566dc3b2b251fcdb | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from rest_framework.reverse import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from users.tests.factories import UserFactory
User = get_user_model()
class CurrentUserViewSetRetrieveTest(APITestCase):
def setUp(self) -> None... | 34.012579 | 100 | 0.555658 | from django.contrib.auth import get_user_model
from rest_framework.reverse import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from users.tests.factories import UserFactory
User = get_user_model()
class CurrentUserViewSetRetrieveTest(APITestCase):
def setUp(self) -> None... | true | true |
f751aa3375a06c99f4544a0dcc5cd567219540b3 | 4,224 | py | Python | tests/units/scripts/test_run_tsfresh.py | snowde/tsfresh | 6cf12fe769762a7c9369a9c78a3a519a28d5c707 | [
"MIT"
] | 4 | 2019-03-24T03:17:09.000Z | 2021-09-28T09:22:49.000Z | tests/units/scripts/test_run_tsfresh.py | snowde/tsfresh | 6cf12fe769762a7c9369a9c78a3a519a28d5c707 | [
"MIT"
] | null | null | null | tests/units/scripts/test_run_tsfresh.py | snowde/tsfresh | 6cf12fe769762a7c9369a9c78a3a519a28d5c707 | [
"MIT"
] | 3 | 2019-01-31T04:34:44.000Z | 2020-04-06T18:19:50.000Z | # -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
import os
import shutil
import tempfile
from unittest import TestCase
from tsfresh.scripts import run_tsfresh
from mock imp... | 41.009709 | 150 | 0.643939 | import os
import shutil
import tempfile
from unittest import TestCase
from tsfresh.scripts import run_tsfresh
from mock import patch
class RunTSFreshTestCase(TestCase):
def setUp(self):
self.test_dir = tempfile.mkdtemp()
os.chdir(self.test_dir)
def extract_features_mock(df... | true | true |
f751ab7a67bba76215cba57f35175b2538edca35 | 1,307 | py | Python | create_tables.py | FedericoSerini/DEND-Project-1-Song-Play-Analysis-With-RDBMS | 4f6d60a5a43877f247bbef4862caa7cd8888e34a | [
"MIT"
] | 8 | 2019-04-15T11:33:09.000Z | 2021-12-07T16:00:15.000Z | create_tables.py | FedericoSerini/DEND-Project-1-Song-Play-Analysis-With-RDBMS | 4f6d60a5a43877f247bbef4862caa7cd8888e34a | [
"MIT"
] | 1 | 2019-07-06T01:05:29.000Z | 2019-07-06T01:08:31.000Z | create_tables.py | FedericoSerini/DEND-Project-1-Song-Play-Analysis-With-RDBMS | 4f6d60a5a43877f247bbef4862caa7cd8888e34a | [
"MIT"
] | 18 | 2019-04-19T21:58:07.000Z | 2021-04-14T21:36:11.000Z | import psycopg2
from sql_queries import create_table_queries, drop_table_queries
def create_database():
# connect to default database
conn = psycopg2.connect("host=127.0.0.1 dbname=studentdb user=student password=student")
conn.set_session(autocommit=True)
cur = conn.cursor()
# create sparkif... | 26.673469 | 93 | 0.701607 | import psycopg2
from sql_queries import create_table_queries, drop_table_queries
def create_database():
conn = psycopg2.connect("host=127.0.0.1 dbname=studentdb user=student password=student")
conn.set_session(autocommit=True)
cur = conn.cursor()
cur.execute("DROP DATABASE IF EXISTS spark... | true | true |
f751ac9a037aeecc0f07f0f8f982df314ee5e8d3 | 47 | py | Python | highcliff/ai/__init__.py | sermelo/Highcliff-SDK | 255dd12b3402361cba8b1ea7a28c506f32a11dae | [
"Apache-2.0"
] | null | null | null | highcliff/ai/__init__.py | sermelo/Highcliff-SDK | 255dd12b3402361cba8b1ea7a28c506f32a11dae | [
"Apache-2.0"
] | null | null | null | highcliff/ai/__init__.py | sermelo/Highcliff-SDK | 255dd12b3402361cba8b1ea7a28c506f32a11dae | [
"Apache-2.0"
] | null | null | null | from highcliff.ai.ai import AI, intent_is_real
| 23.5 | 46 | 0.829787 | from highcliff.ai.ai import AI, intent_is_real
| true | true |
f751adf5525d2d846ef3086c9ee5ba908f4dfa06 | 683 | py | Python | MultiProjectRepository/format-csharp-files.py | linksplatform/Scripts | 91df977b662b5a6c5805835cbb82e9600b5ef717 | [
"MIT"
] | null | null | null | MultiProjectRepository/format-csharp-files.py | linksplatform/Scripts | 91df977b662b5a6c5805835cbb82e9600b5ef717 | [
"MIT"
] | 6 | 2019-10-24T11:45:10.000Z | 2021-11-10T15:06:24.000Z | MultiProjectRepository/format-csharp-files.py | linksplatform/Scripts | 91df977b662b5a6c5805835cbb82e9600b5ef717 | [
"MIT"
] | 2 | 2021-11-09T06:14:54.000Z | 2022-01-18T18:09:41.000Z | #!/usr/bin/python2
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
for line in sys.stdin.readlines():
line = line.strip()
print("\\index{%s}" % (line.replace('_','\\_')))
print("\\begin{section}{%s}" % (line.replace('_','\\_')))
#print "\\inputminted[tabsize=2,breaklines,... | 34.15 | 114 | 0.5959 | import sys
reload(sys)
sys.setdefaultencoding('utf-8')
for line in sys.stdin.readlines():
line = line.strip()
print("\\index{%s}" % (line.replace('_','\\_')))
print("\\begin{section}{%s}" % (line.replace('_','\\_')))
print("\\begin{minted}[tabsize=2,breaklines,breakanywhere,linenos=true,xleftmargin... | false | true |
f751aeefabdcf7eea5e003b0f4546ec2c6dd377c | 20,014 | py | Python | paddlenlp/transformers/bert/modeling.py | BenfengXu/PaddleNLP | eca87fde4a1814a8f028e0e900d1792cbaa5c700 | [
"Apache-2.0"
] | 2 | 2021-06-19T07:27:10.000Z | 2021-06-23T06:22:57.000Z | paddlenlp/transformers/bert/modeling.py | BenfengXu/PaddleNLP | eca87fde4a1814a8f028e0e900d1792cbaa5c700 | [
"Apache-2.0"
] | 1 | 2021-11-22T08:11:08.000Z | 2021-11-22T08:11:08.000Z | paddlenlp/transformers/bert/modeling.py | BenfengXu/PaddleNLP | eca87fde4a1814a8f028e0e900d1792cbaa5c700 | [
"Apache-2.0"
] | 1 | 2021-04-28T09:01:37.000Z | 2021-04-28T09:01:37.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 39.397638 | 108 | 0.610123 |
import paddle
import paddle.nn as nn
import paddle.tensor as tensor
import paddle.nn.functional as F
from paddle.nn import TransformerEncoder, Linear, Layer, Embedding, LayerNorm, Tanh
from .. import PretrainedModel, register_base_model
__all__ = [
'BertModel',
"BertPretrainedModel",
'BertForPretraining'... | true | true |
f751af146af895c2b7971239633f9ed60b77862a | 2,076 | py | Python | mtr/sync/forms.py | mtrgroup/django-mtr-import-export | b8e7a6fa1cbc58b9e2126526f418306a7490cb52 | [
"MIT"
] | null | null | null | mtr/sync/forms.py | mtrgroup/django-mtr-import-export | b8e7a6fa1cbc58b9e2126526f418306a7490cb52 | [
"MIT"
] | null | null | null | mtr/sync/forms.py | mtrgroup/django-mtr-import-export | b8e7a6fa1cbc58b9e2126526f418306a7490cb52 | [
"MIT"
] | null | null | null | from django import forms
from mtr.utils.forms import GlobalInitialFormMixin
from mtr.utils.helpers import model_choices
from .lib.manager import manager
from .models import Settings, Field
# TODO: refactor
class SettingsAdminForm(GlobalInitialFormMixin, forms.ModelForm):
class Meta:
exclude = tuple()... | 33.483871 | 71 | 0.631985 | from django import forms
from mtr.utils.forms import GlobalInitialFormMixin
from mtr.utils.helpers import model_choices
from .lib.manager import manager
from .models import Settings, Field
class SettingsAdminForm(GlobalInitialFormMixin, forms.ModelForm):
class Meta:
exclude = tuple()
model = ... | true | true |
f751af92caa2afcd1c6b5c83ecadff741fa71698 | 15,773 | py | Python | tarbell/app.py | write-this-way/flask-tarbell | 0e23e8d90ba66fde1a961ea530c99d94357ff664 | [
"BSD-3-Clause"
] | 1 | 2016-03-12T21:16:46.000Z | 2016-03-12T21:16:46.000Z | tarbell/app.py | write-this-way/flask-tarbell | 0e23e8d90ba66fde1a961ea530c99d94357ff664 | [
"BSD-3-Clause"
] | null | null | null | tarbell/app.py | write-this-way/flask-tarbell | 0e23e8d90ba66fde1a961ea530c99d94357ff664 | [
"BSD-3-Clause"
] | null | null | null | import os
import json
import imp
import mimetypes
import xlrd
import csv
import re
import requests
import time
import sys
import traceback
from httplib import BadStatusLine
from flask import Flask, render_template, send_from_directory, Response
from jinja2 import Markup, TemplateSyntaxError
from jinja2.loaders import ... | 34.818985 | 109 | 0.569137 | import os
import json
import imp
import mimetypes
import xlrd
import csv
import re
import requests
import time
import sys
import traceback
from httplib import BadStatusLine
from flask import Flask, render_template, send_from_directory, Response
from jinja2 import Markup, TemplateSyntaxError
from jinja2.loaders import ... | true | true |
f751b039578a7c622060bbd33808632d2dc01c69 | 8,787 | py | Python | tests/h/routes_test.py | julien-cheng/h | 36c8ec044725720cf36f0986cdf025395aca8929 | [
"BSD-2-Clause"
] | 2 | 2019-08-04T07:22:11.000Z | 2020-07-17T05:01:41.000Z | tests/h/routes_test.py | 11-eleven-11/h | 91c7a4504ad7471ed3e30246763a03e6c1cc531b | [
"BSD-2-Clause"
] | null | null | null | tests/h/routes_test.py | 11-eleven-11/h | 91c7a4504ad7471ed3e30246763a03e6c1cc531b | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from mock import Mock, call
from h.routes import includeme
def test_includeme():
config = Mock(spec_set=["add_route"])
includeme(config)
# This may look like a ridiculous test, but the cost of keeping it
# up-to-date is hopefully pre... | 37.551282 | 89 | 0.528963 |
from __future__ import unicode_literals
from mock import Mock, call
from h.routes import includeme
def test_includeme():
config = Mock(spec_set=["add_route"])
includeme(config)
assert config.add_route.mock_calls == [
call("index", "/"),
call("robots", "/robots.txt"),
... | true | true |
f751b2a07c67e64383b56ba867bb9902f7d9e662 | 9,534 | py | Python | canteen_tests/test_base/test_handler.py | dbl0null/canteen | 3bef22a2059ef6ac5df178324fbc1dba45316e22 | [
"MIT"
] | 2 | 2016-08-24T18:42:41.000Z | 2017-12-08T00:41:02.000Z | canteen_tests/test_base/test_handler.py | dbl0null/canteen | 3bef22a2059ef6ac5df178324fbc1dba45316e22 | [
"MIT"
] | null | null | null | canteen_tests/test_base/test_handler.py | dbl0null/canteen | 3bef22a2059ef6ac5df178324fbc1dba45316e22 | [
"MIT"
] | 2 | 2015-09-22T05:36:27.000Z | 2017-12-08T00:41:21.000Z | # -*- coding: utf-8 -*-
"""
base handler tests
~~~~~~~~~~~~~~~~~~
:author: Sam Gammon <sg@samgammon.com>
:copyright: (c) Sam Gammon, 2014
:license: This software makes use of the MIT Open Source License.
A copy of this license is included as ``LICENSE.md`` in
the root of the project... | 26.705882 | 79 | 0.660688 |
from canteen import test
from canteen.base import handler
from canteen.logic import template
from canteen.logic.http import semantics
from canteen.core import runtime as rtime
from canteen.util.config import Config
from werkzeug import test as wtest
from werkzeug.wrappers import Request
from werkzeug.wrappers impo... | true | true |
f751b2a9c4e8a33a0004acd5121ea9317e8ae8b5 | 3,938 | py | Python | database/_database/python_files/function_batch_commit.py | gendry/solpybas | 1ff8554f0871994871a0878464fac5bb47428d1d | [
"MIT"
] | null | null | null | database/_database/python_files/function_batch_commit.py | gendry/solpybas | 1ff8554f0871994871a0878464fac5bb47428d1d | [
"MIT"
] | null | null | null | database/_database/python_files/function_batch_commit.py | gendry/solpybas | 1ff8554f0871994871a0878464fac5bb47428d1d | [
"MIT"
] | null | null | null | import sqlite3
#This generically adds stuff to the depositions / treatments and dep_conds / treatmetn_conds tables...
def batch_commit_function(self, conn, splits_lst, batch_dict):
status = 'No status yet'
#TABLE device_stacks (id INTEGER PRIMARY KEY, stack_name TEXT, bot_elec_pat INTEGER, top_elec_pat INTEGER)
#TAB... | 39.38 | 267 | 0.730066 | import sqlite3
def batch_commit_function(self, conn, splits_lst, batch_dict):
status = 'No status yet'
device_batches_id_max = conn.execute('SELECT max(id) FROM device_batches')
device_batches_id_max_result = device_batches_id_max.fetchone()[0]
#convert to string to test truth value
string_device_batc... | false | true |
f751b39e755638fce65a8cc5ec944917ef0127ce | 5,219 | py | Python | trt_int8_quant.py | yihui8776/TensorRT-DETR | 1f32e9a2f98e26ec5b2376f9a2695193887430fb | [
"Apache-2.0"
] | 61 | 2021-04-29T08:10:20.000Z | 2022-03-30T10:13:13.000Z | trt_int8_quant.py | yihui8776/TensorRT-DETR | 1f32e9a2f98e26ec5b2376f9a2695193887430fb | [
"Apache-2.0"
] | 3 | 2021-07-15T05:42:49.000Z | 2021-09-24T04:24:52.000Z | trt_int8_quant.py | yihui8776/TensorRT-DETR | 1f32e9a2f98e26ec5b2376f9a2695193887430fb | [
"Apache-2.0"
] | 10 | 2021-05-18T16:04:50.000Z | 2022-03-11T06:31:38.000Z |
#
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 42.08871 | 200 | 0.682315 |
import os
import glob
import cv2
from PIL import Image
import numpy as np
import argparse
import torchvision.transforms as T
from trt_util.common import build_engine_onnx_v2
from trt_util.calibrator import Calibrator
transform = T.Compose([
T.Resize((800,800)), T.ToTensor(),
T.Normalize([0.485, 0.456,... | true | true |
f751b40d1eb6e2346a2040fffd223b2987cd5bae | 2,144 | py | Python | alembic/versions/20210120221155_6183aa4c39c7_initial_setup.py | takotab/cloudrun-fastapi | 515145dc68f49b222cf582940368fdba4b6dcfd3 | [
"MIT"
] | 74 | 2020-02-06T18:20:36.000Z | 2021-11-28T11:46:02.000Z | alembic/versions/20210120221155_6183aa4c39c7_initial_setup.py | takotab/cloudrun-fastapi | 515145dc68f49b222cf582940368fdba4b6dcfd3 | [
"MIT"
] | 13 | 2020-03-03T01:00:27.000Z | 2021-10-21T17:11:15.000Z | alembic/versions/20210120221155_6183aa4c39c7_initial_setup.py | takotab/cloudrun-fastapi | 515145dc68f49b222cf582940368fdba4b6dcfd3 | [
"MIT"
] | 17 | 2020-02-08T13:20:21.000Z | 2021-11-02T10:19:16.000Z | """initial setup
Revision ID: 6183aa4c39c7
Revises:
Create Date: 2021-01-20 22:11:55.367985+00:00
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '6183aa4c39c7'
down_revision = None
branch_labels = None
depends_on = No... | 37.614035 | 81 | 0.678172 | from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '6183aa4c39c7'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table('users',
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
sa.Column('email', sa... | true | true |
f751b45b142e44df8292677d3e20ebd607f09338 | 12,567 | py | Python | cirq/optimizers/eject_phased_paulis.py | rajeshkumarkarra/Cirq | 5ad06cc7a487ca94436715a3c51b6a50dfd10513 | [
"Apache-2.0"
] | 1 | 2019-09-04T16:55:30.000Z | 2019-09-04T16:55:30.000Z | cirq/optimizers/eject_phased_paulis.py | rajeshkumarkarra/Cirq | 5ad06cc7a487ca94436715a3c51b6a50dfd10513 | [
"Apache-2.0"
] | null | null | null | cirq/optimizers/eject_phased_paulis.py | rajeshkumarkarra/Cirq | 5ad06cc7a487ca94436715a3c51b6a50dfd10513 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# 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 ... | 35.905714 | 80 | 0.517944 |
from typing import Optional, cast, TYPE_CHECKING, Iterable, Tuple
import sympy
from cirq import circuits, ops, value, protocols
from cirq.optimizers import decompositions
if TYPE_CHECKING:
from typing import Dict, List
class _OptimizerState:
def __init__(self):
self.held_w_phases = {}
... | true | true |
f751b500ac351bb61d82b321afe07ff45df02c52 | 8,323 | py | Python | share/inputDataProcessor/farm_processor.py | eirikur16/flrs | c98604593753def05086b54ce82f5551f01d2529 | [
"Apache-2.0"
] | 91 | 2019-06-04T08:56:29.000Z | 2022-03-13T17:39:22.000Z | share/inputDataProcessor/farm_processor.py | eirikur16/flrs | c98604593753def05086b54ce82f5551f01d2529 | [
"Apache-2.0"
] | 224 | 2019-04-08T22:03:45.000Z | 2022-03-31T17:56:09.000Z | share/inputDataProcessor/farm_processor.py | eirikur16/flrs | c98604593753def05086b54ce82f5551f01d2529 | [
"Apache-2.0"
] | 97 | 2019-04-23T20:48:20.000Z | 2022-03-29T08:17:02.000Z | """
Script to process wind farm & turbine csv downloaded from: https://eerscmap.usgs.gov/uswtdb/data/
Metadata description can be found at https://eerscmap.usgs.gov/uswtdb/assets/data/uswtdb_v1_0_20180419.xml
Disregarding the following attributes for now:
t_rsa turbine rotor swept area square meters
t_ttlh turbine tot... | 37.660633 | 110 | 0.531779 |
import os
import csv
import sys
import copy
import json
import getopt
import utm
intermediate_file = "farms.json"
template_file = "../inputFormApp/inputFiles/example_input_file.json"
generated_files_directory = "./generatedInputFiles"
def main(argv):
filename = None
try:
opts, args = getopt.getopt... | true | true |
f751b5d7401039834933fc95d83087048bdaf4af | 1,244 | py | Python | tests/pyre/components/component_instance_binding_deferred.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | 3 | 2019-08-02T21:02:47.000Z | 2021-09-08T13:59:43.000Z | tests/pyre/components/component_instance_binding_deferred.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | tests/pyre/components/component_instance_binding_deferred.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
import pyre
class ifac(pyre.protocol, family="deferred.ifac"):
"""sample protocol"""
@classmethod
def pyre_default(cls, **kwds): return comp
class comp(pyre.component, family="defer... | 23.037037 | 73 | 0.659968 |
import pyre
class ifac(pyre.protocol, family="deferred.ifac"):
@classmethod
def pyre_default(cls, **kwds): return comp
class comp(pyre.component, family="deferred.ifac.comp", implements=ifac):
tag = pyre.properties.str()
class user(pyre.component, family="deferred.user"):
comp = pyre.facility(proto... | true | true |
f751b71a4a017dc3870da1e1445820b6c521e1ce | 10,748 | py | Python | src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py | Jcc99/Adafruit_Blinka | 41f8155bab83039ed9d45276addd3d501e83f3e6 | [
"MIT"
] | 294 | 2018-06-30T19:08:27.000Z | 2022-03-26T21:08:47.000Z | src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py | Jcc99/Adafruit_Blinka | 41f8155bab83039ed9d45276addd3d501e83f3e6 | [
"MIT"
] | 421 | 2018-06-30T20:54:46.000Z | 2022-03-31T15:08:37.000Z | src/adafruit_blinka/microcontroller/generic_linux/sysfs_pwmout.py | Jcc99/Adafruit_Blinka | 41f8155bab83039ed9d45276addd3d501e83f3e6 | [
"MIT"
] | 234 | 2018-07-23T18:49:16.000Z | 2022-03-28T16:59:48.000Z | """
Much code from https://github.com/vsergeev/python-periphery/blob/master/periphery/pwm.py
Copyright (c) 2015-2016 vsergeev / Ivan (Vanya) A. Sergeev
License: MIT
"""
import os
from time import sleep
from errno import EACCES
try:
from microcontroller.pin import pwmOuts
except ImportError:
raise RuntimeError... | 30.796562 | 89 | 0.588947 |
import os
from time import sleep
from errno import EACCES
try:
from microcontroller.pin import pwmOuts
except ImportError:
raise RuntimeError("No PWM outputs defined for this board") from ImportError
class PWMError(IOError):
pass
class PWMOut:
PWM_STAT_RETRIES = 10
PWM_STAT_DELAY =... | true | true |
f751b7a518e10677ba93e80af273766f1a342146 | 10,661 | py | Python | differential_privacy/dp_sgd/dp_optimizer/utils.py | robrkerr/tensorflow-models | 3656a07e89be134c2bc333c60a6c709e475024a6 | [
"Apache-2.0"
] | 308 | 2018-09-06T18:46:57.000Z | 2022-03-28T08:22:45.000Z | differential_privacy/dp_sgd/dp_optimizer/utils.py | robrkerr/tensorflow-models | 3656a07e89be134c2bc333c60a6c709e475024a6 | [
"Apache-2.0"
] | 64 | 2018-06-20T10:14:17.000Z | 2021-09-08T05:58:25.000Z | differential_privacy/dp_sgd/dp_optimizer/utils.py | robrkerr/tensorflow-models | 3656a07e89be134c2bc333c60a6c709e475024a6 | [
"Apache-2.0"
] | 69 | 2018-09-18T12:06:56.000Z | 2022-03-14T11:49:16.000Z | # 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... | 34.060703 | 80 | 0.657443 |
from __future__ import division
import math
import numpy
import tensorflow as tf
class LayerParameters(object):
def __init__(self):
self.name = ""
self.num_units = 0
self._with_bias = False
self.relu = False
self.gradient_l2norm_bound = 0.0
self.bias_gradient_l2norm_bound = 0.0
self.t... | true | true |
f751b7ad6e15b0e362cd226b9b138fb404bef1c2 | 975 | py | Python | Quintana_Jerrod/Assignments/flask_fundamentals/great_number_game/ngame.py | webguru001/Python-Django-Web | 6264bc4c90ef1432ba0902c76b567cf3caaae221 | [
"MIT"
] | 5 | 2019-05-17T01:30:02.000Z | 2021-06-17T21:02:58.000Z | Quintana_Jerrod/Assignments/flask_fundamentals/great_number_game/ngame.py | curest0x1021/Python-Django-Web | 6264bc4c90ef1432ba0902c76b567cf3caaae221 | [
"MIT"
] | null | null | null | Quintana_Jerrod/Assignments/flask_fundamentals/great_number_game/ngame.py | curest0x1021/Python-Django-Web | 6264bc4c90ef1432ba0902c76b567cf3caaae221 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, session, redirect, request
import random
app = Flask(__name__)
app.secret_key='This'
@app.route('/')
def start():
if not ('num') in session:
session['num'] = random.randrange(0,101)
print session['num']
num = session['num']
if ('guess') in session:
... | 27.857143 | 73 | 0.590769 | from flask import Flask, render_template, session, redirect, request
import random
app = Flask(__name__)
app.secret_key='This'
@app.route('/')
def start():
if not ('num') in session:
session['num'] = random.randrange(0,101)
print session['num']
num = session['num']
if ('guess') in session:
... | false | true |
f751b877d0166f8f3fa25b4d087410e3df1354b2 | 31,937 | py | Python | app/common/database.py | B611/nyja | 5169bc21a1ff3026d9915cb2774ecf381b3316e1 | [
"MIT"
] | 1 | 2021-11-10T16:42:33.000Z | 2021-11-10T16:42:33.000Z | app/common/database.py | B611/nyja | 5169bc21a1ff3026d9915cb2774ecf381b3316e1 | [
"MIT"
] | null | null | null | app/common/database.py | B611/nyja | 5169bc21a1ff3026d9915cb2774ecf381b3316e1 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
import os
import hashlib
from datetime import datetime
import common.misc as misc
# Perform advanced search in the database
def search_nested(args):
try:
# If user wants to retrieve all the database
if args.NESTED[0] == 'ALL':
print('Search for all websi... | 41.10296 | 127 | 0.56934 | from pymongo import MongoClient
import os
import hashlib
from datetime import datetime
import common.misc as misc
def search_nested(args):
try:
if args.NESTED[0] == 'ALL':
print('Search for all websites :')
print('\n')
client = MongoClient(
... | true | true |
f751b95552a0b9a87022c05e2d6c1c8d426941f8 | 1,950 | py | Python | tests/test_redis.py | azhai/rdcache | 8f3ca558a2a9af11321916bfe548aaeb66ef75ae | [
"MIT"
] | null | null | null | tests/test_redis.py | azhai/rdcache | 8f3ca558a2a9af11321916bfe548aaeb66ef75ae | [
"MIT"
] | null | null | null | tests/test_redis.py | azhai/rdcache | 8f3ca558a2a9af11321916bfe548aaeb66ef75ae | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from datetime import date
from rdcache.ext import RedisCache, RedisPool
redis = RedisPool({
"default": {
"host": "127.0.0.1",
"port": 6379,
"password": "",
"db": 0,
},
})
backend = redis.get('default')
cache = RedisCache(backend, touch = ... | 27.464789 | 81 | 0.586667 |
import unittest
from datetime import date
from rdcache.ext import RedisCache, RedisPool
redis = RedisPool({
"default": {
"host": "127.0.0.1",
"port": 6379,
"password": "",
"db": 0,
},
})
backend = redis.get('default')
cache = RedisCache(backend, touch = True)
user_rows = {
... | true | true |
f751ba178fd593c45f58ddd0b43b2cf20c7e1aa8 | 1,517 | py | Python | Chapter12/my_app/__init__.py | shalevy1/Flask-Framework-Cookbook-Second-Edition | e219c3c243f147fa6ebd09c114b08ea2b9109cfa | [
"MIT"
] | 42 | 2019-07-21T09:10:17.000Z | 2022-02-21T01:12:18.000Z | Chapter12/my_app/__init__.py | shalevy1/Flask-Framework-Cookbook-Second-Edition | e219c3c243f147fa6ebd09c114b08ea2b9109cfa | [
"MIT"
] | 2 | 2019-09-11T16:17:06.000Z | 2021-03-01T18:46:20.000Z | Chapter12/my_app/__init__.py | shalevy1/Flask-Framework-Cookbook-Second-Edition | e219c3c243f147fa6ebd09c114b08ea2b9109cfa | [
"MIT"
] | 45 | 2019-07-17T22:50:28.000Z | 2022-03-23T13:52:59.000Z | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from elasticsearch import Elasticsearch
from flask_caching import Cache
from flask_mail import Mail
from celery import Celery
app = Flask(__name__)
app.config['SERVER_NAME'] = 'localhost:5000'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test... | 27.581818 | 67 | 0.719842 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from elasticsearch import Elasticsearch
from flask_caching import Cache
from flask_mail import Mail
from celery import Celery
app = Flask(__name__)
app.config['SERVER_NAME'] = 'localhost:5000'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test... | true | true |
f751ba9db0d039dff8f6bf54d37cd596feb55b62 | 1,956 | py | Python | tests/test_visitors/test_ast/test_operators/test_useless_operators_before_numbers.py | teners/wemake-python-styleguide | fe01384c808e6908b19c6bad3ad85a834f6dc533 | [
"MIT"
] | 1 | 2019-01-31T00:06:43.000Z | 2019-01-31T00:06:43.000Z | tests/test_visitors/test_ast/test_operators/test_useless_operators_before_numbers.py | teners/wemake-python-styleguide | fe01384c808e6908b19c6bad3ad85a834f6dc533 | [
"MIT"
] | 1 | 2019-10-09T16:57:12.000Z | 2019-10-09T16:57:12.000Z | tests/test_visitors/test_ast/test_operators/test_useless_operators_before_numbers.py | raghav-ys/wemake-python-styleguide | edb4a88923205448b29972ad0bc2862df5a569c5 | [
"MIT"
] | 1 | 2019-12-12T19:18:58.000Z | 2019-12-12T19:18:58.000Z | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
UselessOperatorsViolation,
)
from wemake_python_styleguide.visitors.ast.operators import (
UselessOperatorsVisitor,
)
# Usages:
assignment = 'constant = {0}'
assignment_addition = 'constant = x + {0}'
assignme... | 21.032258 | 69 | 0.654908 |
import pytest
from wemake_python_styleguide.violations.consistency import (
UselessOperatorsViolation,
)
from wemake_python_styleguide.visitors.ast.operators import (
UselessOperatorsVisitor,
)
assignment = 'constant = {0}'
assignment_addition = 'constant = x + {0}'
assignment_increment = 'constant += {0}'
... | true | true |
f751baa9cae2f51f9d95e3dd65a91255a6dd4859 | 17,891 | py | Python | boto/glacier/layer1.py | bopopescu/boto-hk7y1hi14s37zwkm | 093663068a9a92ddb2224be617e74b086c92517e | [
"MIT"
] | null | null | null | boto/glacier/layer1.py | bopopescu/boto-hk7y1hi14s37zwkm | 093663068a9a92ddb2224be617e74b086c92517e | [
"MIT"
] | 1 | 2021-04-30T21:19:53.000Z | 2021-04-30T21:19:53.000Z | boto/glacier/layer1.py | bopopescu/boto-hk7y1hi14s37zwkm | 093663068a9a92ddb2224be617e74b086c92517e | [
"MIT"
] | 1 | 2020-07-25T22:31:28.000Z | 2020-07-25T22:31:28.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal ... | 42.597619 | 81 | 0.626181 |
import json
import boto.glacier
from boto.connection import AWSAuthConnection
boto.set_stream_logger('glacier')
class Layer1(AWSAuthConnection):
Version = '2012-06-01'
def __init__(self, aws_access_key_id=None, aws_secret_access_key=None,
account_id='-', is_secure=True, port=None,
... | true | true |
f751bb7f36189dd2bf94743f3c975d6aa42977ce | 2,591 | py | Python | lite/tests/unittest_py/op/test_tril_triu_op.py | 714627034/Paddle-Lite | 015ba88a4d639db0b73603e37f83e47be041a4eb | [
"Apache-2.0"
] | 808 | 2018-04-17T17:43:12.000Z | 2019-08-18T07:39:13.000Z | lite/tests/unittest_py/op/test_tril_triu_op.py | 714627034/Paddle-Lite | 015ba88a4d639db0b73603e37f83e47be041a4eb | [
"Apache-2.0"
] | 728 | 2018-04-18T08:15:25.000Z | 2019-08-16T07:14:43.000Z | lite/tests/unittest_py/op/test_tril_triu_op.py | 714627034/Paddle-Lite | 015ba88a4d639db0b73603e37f83e47be041a4eb | [
"Apache-2.0"
] | 364 | 2018-04-18T17:05:02.000Z | 2019-08-18T03:25:38.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 34.546667 | 125 | 0.670783 |
import sys
sys.path.append('../')
from auto_scan_test import AutoScanTest, IgnoreReasons
from program_config import TensorConfig, ProgramConfig, OpConfig, CxxConfig, TargetType, PrecisionType, DataLayoutType, Place
import unittest
import hypothesis
from hypothesis import given, settings, seed, example, assume
import... | true | true |
f751bbb0f274dc9fd5dc7b7cbcd509445ff0f67e | 6,237 | py | Python | ports/nrf/examples/seeed_tft.py | mtuxpe/makerdiary | d72738111eb92a01d6955f4e1f3f56c2a925d252 | [
"MIT"
] | 2 | 2018-07-17T09:19:05.000Z | 2021-03-27T01:21:06.000Z | ports/nrf/examples/seeed_tft.py | mtuxpe/makerdiary | d72738111eb92a01d6955f4e1f3f56c2a925d252 | [
"MIT"
] | null | null | null | ports/nrf/examples/seeed_tft.py | mtuxpe/makerdiary | d72738111eb92a01d6955f4e1f3f56c2a925d252 | [
"MIT"
] | 2 | 2018-07-17T09:23:52.000Z | 2019-08-08T22:48:17.000Z | # This file is part of the MicroPython project, http://micropython.org/
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Glenn Ruben Bakke
#
# 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 wi... | 29.559242 | 126 | 0.611512 |
import os
import time
import framebuf
from machine import SPI, Pin
from sdcard import SDCard
def mount_tf(self, mount_point="/"):
sd = SDCard(SPI(0), Pin("A15", mode=Pin.OUT))
os.mount(sd, mount_point)
class ILI9341:
def __init__(self, width, height):
self.width = width
self.height = hei... | true | true |
f751bc38b5afce2a4569f7c17ad5e8f109093a0f | 3,621 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/interface/get/get_interface_information/test_api_get_interface_information.py | CiscoTestAutomation/genielibs | becee8a1a85f4973e00859e3244e2c8fe45a394c | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/interface/get/get_interface_information/test_api_get_interface_information.py | CiscoTestAutomation/genielibs | becee8a1a85f4973e00859e3244e2c8fe45a394c | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/apis/tests/nxos/interface/get/get_interface_information/test_api_get_interface_information.py | CiscoTestAutomation/genielibs | becee8a1a85f4973e00859e3244e2c8fe45a394c | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | import unittest
from pyats.topology import loader
from genie.libs.sdk.apis.nxos.interface.get import get_interface_information
class TestGetInterfaceInformation(unittest.TestCase):
@classmethod
def setUpClass(self):
testbed = """
devices:
R3_nx:
connections:
... | 44.703704 | 94 | 0.388567 | import unittest
from pyats.topology import loader
from genie.libs.sdk.apis.nxos.interface.get import get_interface_information
class TestGetInterfaceInformation(unittest.TestCase):
@classmethod
def setUpClass(self):
testbed = """
devices:
R3_nx:
connections:
... | true | true |
f751bf9ac155476a04a92cd0d5020b405d821301 | 15,656 | py | Python | tests/test_internals_database.py | fs111/datasette | c6ff1f23e6a0b26dde8f5b30be3b868b031b6ecf | [
"Apache-2.0"
] | 1 | 2021-04-11T10:19:24.000Z | 2021-04-11T10:19:24.000Z | tests/test_internals_database.py | fs111/datasette | c6ff1f23e6a0b26dde8f5b30be3b868b031b6ecf | [
"Apache-2.0"
] | 4 | 2021-07-11T06:56:18.000Z | 2021-09-14T13:14:21.000Z | tests/test_internals_database.py | sthagen/datasette | e99b7e77697ae3d081e39604069cba6a8c5b6dcd | [
"Apache-2.0"
] | null | null | null | """
Tests for the datasette.database.Database class
"""
from datasette.database import Database, Results, MultipleValues
from datasette.utils.sqlite import sqlite3
from datasette.utils import Column
from .fixtures import app_client, app_client_two_attached_databases_crossdb_enabled
import pytest
import time
import uuid... | 29.373358 | 97 | 0.513541 | from datasette.database import Database, Results, MultipleValues
from datasette.utils.sqlite import sqlite3
from datasette.utils import Column
from .fixtures import app_client, app_client_two_attached_databases_crossdb_enabled
import pytest
import time
import uuid
@pytest.fixture
def db(app_client):
return app_cl... | true | true |
f751bfb2832cfe6cbe1cf29d28886c1b48d31466 | 1,528 | py | Python | aiomangadex/partialchapter.py | lukesaltweather/aiomangadex | 76119c89f7ad387efa321abfb960a359486b9ff4 | [
"Apache-2.0"
] | 1 | 2020-11-09T00:13:50.000Z | 2020-11-09T00:13:50.000Z | aiomangadex/partialchapter.py | lukesaltweather/aiomangadex | 76119c89f7ad387efa321abfb960a359486b9ff4 | [
"Apache-2.0"
] | 3 | 2020-06-14T00:31:56.000Z | 2020-07-02T15:32:57.000Z | aiomangadex/partialchapter.py | lukesaltweather/aiomangadex | 76119c89f7ad387efa321abfb960a359486b9ff4 | [
"Apache-2.0"
] | null | null | null | from collections import namedtuple
from dataclasses import dataclass, field
from datetime import datetime
from typing import List
from .base import MangadexBase
from .exceptions import MangadexException
from .group import Group
from .language import Language
@dataclass(frozen=True)
class PartialChapter(MangadexBase):... | 33.217391 | 105 | 0.717932 | from collections import namedtuple
from dataclasses import dataclass, field
from datetime import datetime
from typing import List
from .base import MangadexBase
from .exceptions import MangadexException
from .group import Group
from .language import Language
@dataclass(frozen=True)
class PartialChapter(MangadexBase):... | true | true |
f751c08b3373387afcfc6a54c12268114411b2b5 | 1,853 | py | Python | tensorflow_compression/__init__.py | jtpils/compression | b758903c6df5eeafb5d444e8cec85d1b2bc132d3 | [
"Apache-2.0"
] | 1 | 2019-07-21T14:10:17.000Z | 2019-07-21T14:10:17.000Z | tensorflow_compression/__init__.py | jtpils/compression | b758903c6df5eeafb5d444e8cec85d1b2bc132d3 | [
"Apache-2.0"
] | null | null | null | tensorflow_compression/__init__.py | jtpils/compression | b758903c6df5eeafb5d444e8cec85d1b2bc132d3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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... | 45.195122 | 80 | 0.760389 |
from __future__ import absolute_import as _absolute_import
from __future__ import division as _division
from __future__ import print_function as _print_function
try:
import tensorflow as _tensorflow
_tf_version = [int(v) for v in _tensorflow.version.VERSION.split(".")]
assert _tf_version[0] == 1 and _tf_version... | true | true |
f751c0f225021910c3c0d6ffbcdca66064e5f7d7 | 38,347 | py | Python | src/transformers/models/flaubert/modeling_tf_flaubert.py | elusenji/transformers | af14c61973effd8b8077ac61b3f24bdd4a632f25 | [
"Apache-2.0"
] | 3 | 2022-01-15T08:06:07.000Z | 2022-03-10T07:13:18.000Z | src/transformers/models/flaubert/modeling_tf_flaubert.py | arron1227/transformers | b18dfd95e1f60ae65a959a7b255fc06522170d1b | [
"Apache-2.0"
] | 1 | 2022-03-26T12:10:11.000Z | 2022-03-26T12:10:11.000Z | src/transformers/models/flaubert/modeling_tf_flaubert.py | arron1227/transformers | b18dfd95e1f60ae65a959a7b255fc06522170d1b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 42.560488 | 151 | 0.646804 |
import itertools
import random
import warnings
from dataclasses import dataclass
from typing import Dict, Optional, Tuple, Union
import numpy as np
import tensorflow as tf
from ...activations_tf import get_tf_activation
from ...modeling_tf_outputs import TFBaseModelOutput
from ...modeling_tf_utils import (
TFPre... | true | true |
f751c1566761a27e37478d2321cad3ff73d714d9 | 3,147 | py | Python | rhea-pkg/rhea/broker.py | panoszvg/NTUA-Analysis-and-Design-of-Information-Systems | dcb6f8d39e375d3075eeee3a12f5f6a6500629ad | [
"MIT"
] | null | null | null | rhea-pkg/rhea/broker.py | panoszvg/NTUA-Analysis-and-Design-of-Information-Systems | dcb6f8d39e375d3075eeee3a12f5f6a6500629ad | [
"MIT"
] | null | null | null | rhea-pkg/rhea/broker.py | panoszvg/NTUA-Analysis-and-Design-of-Information-Systems | dcb6f8d39e375d3075eeee3a12f5f6a6500629ad | [
"MIT"
] | null | null | null | import pika
class Broker:
def __init__(self, area):
# Validate broker attributes
if area not in ["A", "B", "C", "D"]:
raise ValueError(
"Please provide a valid sender area. [A, B, C, D]"
)
self.area = area
self.connection = None
... | 31.787879 | 88 | 0.563394 | import pika
class Broker:
def __init__(self, area):
if area not in ["A", "B", "C", "D"]:
raise ValueError(
"Please provide a valid sender area. [A, B, C, D]"
)
self.area = area
self.connection = None
self.channel = None
... | true | true |
f751c1a7b8557d111ece974fe0337ad5501315ca | 34 | py | Python | test/__init__.py | JugalBoro/trip-based-routing- | 66fd2095d6c072d16fe8d5a7ef0912ee72b22c08 | [
"WTFPL"
] | 43 | 2016-10-10T18:31:35.000Z | 2022-03-14T06:25:28.000Z | test/__init__.py | JugalBoro/trip-based-routing- | 66fd2095d6c072d16fe8d5a7ef0912ee72b22c08 | [
"WTFPL"
] | null | null | null | test/__init__.py | JugalBoro/trip-based-routing- | 66fd2095d6c072d16fe8d5a7ef0912ee72b22c08 | [
"WTFPL"
] | 8 | 2017-09-27T10:55:27.000Z | 2020-08-09T04:14:00.000Z | from . import _common
c = _common
| 11.333333 | 21 | 0.735294 | from . import _common
c = _common
| true | true |
f751c1f6c5fb0e20584bd0d7e26e7844ebb7692c | 1,709 | py | Python | stubs/3.2/posixpath.py | TimSimpsonR/mypy | 5e6fd6335e0662b0477e1d678269f33e6f4194ba | [
"PSF-2.0"
] | 1 | 2019-06-16T07:05:32.000Z | 2019-06-16T07:05:32.000Z | stubs/3.2/posixpath.py | zyga/mypy | 5b7e222568cd20c31cde4e02adc9fd77d949197a | [
"PSF-2.0"
] | null | null | null | stubs/3.2/posixpath.py | zyga/mypy | 5b7e222568cd20c31cde4e02adc9fd77d949197a | [
"PSF-2.0"
] | null | null | null | # Stubs for os.path
# Ron Murawski <ron@horizonchess.com>
# based on http://docs.python.org/3.2/library/os.path.html
from typing import Any, List, Tuple, IO, overload
# ----- os.path variables -----
supports_unicode_filenames = False
# ----- os.path function stubs -----
def abspath(path: str) -> str: pass
def basen... | 36.361702 | 78 | 0.6811 |
from typing import Any, List, Tuple, IO, overload
supports_unicode_filenames = False
def abspath(path: str) -> str: pass
def basename(path) -> str: pass
def commonprefix(list: List[str]) -> str: pass
def dirname(path: str) -> str: pass
def exists(path: str) -> bool: pass
def lexists(path: str) -> bool: pass
def exp... | true | true |
f751c3e6171e5dd6de2f88177f415d072de31d10 | 55,607 | py | Python | SPC-MGR.py | Kali-Hac/SPC-MGR | 3eccceeba97e0dca62132187c6645b98620f3bd1 | [
"MIT"
] | null | null | null | SPC-MGR.py | Kali-Hac/SPC-MGR | 3eccceeba97e0dca62132187c6645b98620f3bd1 | [
"MIT"
] | null | null | null | SPC-MGR.py | Kali-Hac/SPC-MGR | 3eccceeba97e0dca62132187c6645b98620f3bd1 | [
"MIT"
] | 1 | 2021-12-30T09:17:49.000Z | 2021-12-30T09:17:49.000Z | """
The SPC-MGR is built based in part on graph attention mechanism (https://arxiv.org/abs/1710.10903),
part on MG-SCR (https://www.ijcai.org/proceedings/2021/0135),
and includes open-source codes provided by
the project of Graph Attention Network (GAT) at https://github.com/PetarV-/GAT,
and the project of MG-SCR ... | 44.916801 | 174 | 0.594493 |
import time
import numpy as np
import tensorflow as tf
import os, sys
from models import GAT as MSRL from utils import process_L3 as process
from utils.faiss_rerank import compute_jaccard_distance
from tensorflow.python.layers.core import Dense
from sklearn.preprocessing import label_binarize
from sklearn.cl... | true | true |
f751c478e6a9dbe80f2cf47f74c63d8192f192df | 1,377 | py | Python | otp/launcher/DownloadWatcher.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | null | null | null | otp/launcher/DownloadWatcher.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 1 | 2021-06-08T17:16:48.000Z | 2021-06-08T17:16:48.000Z | otp/launcher/DownloadWatcher.py | SuperM0use24/TT-CL-Edition | fdad8394f0656ae122b687d603f72afafd220c65 | [
"MIT"
] | 3 | 2021-06-03T05:36:36.000Z | 2021-06-22T15:07:31.000Z | from direct.task import Task
from otp.otpbase import OTPLocalizer
from direct.gui.DirectGui import *
from panda3d.core import *
from direct.showbase.DirectObject import DirectObject
class DownloadWatcher(DirectObject):
def __init__(self, phaseNames):
self.phaseNames = phaseNames
self.text = Direct... | 47.482759 | 241 | 0.668845 | from direct.task import Task
from otp.otpbase import OTPLocalizer
from direct.gui.DirectGui import *
from panda3d.core import *
from direct.showbase.DirectObject import DirectObject
class DownloadWatcher(DirectObject):
def __init__(self, phaseNames):
self.phaseNames = phaseNames
self.text = Direct... | true | true |
f751c4b101d4b854a0612bf468ad9be0be696cd8 | 7,082 | py | Python | ircclient/ircclient.py | serpis/pynik | 074e6b2d2282557976eee3681d8bfcd5659c011e | [
"MIT"
] | 4 | 2016-08-09T21:25:23.000Z | 2019-08-16T21:55:17.000Z | ircclient/ircclient.py | serpis/pynik | 074e6b2d2282557976eee3681d8bfcd5659c011e | [
"MIT"
] | 10 | 2015-01-25T21:25:22.000Z | 2021-01-28T19:50:22.000Z | ircclient/ircclient.py | serpis/pynik | 074e6b2d2282557976eee3681d8bfcd5659c011e | [
"MIT"
] | 4 | 2015-05-06T21:45:39.000Z | 2018-07-02T16:47:36.000Z | from __future__ import with_statement
import sys
import socket
import re
import time
import datetime
import errno
def timestamp():
return datetime.datetime.now().strftime("[%H:%M:%S]")
class IRCClient:
def __init__(self, address, port, nick, username, realname):
self.connected = False
self.active_session = Fal... | 24.50519 | 114 | 0.662101 | from __future__ import with_statement
import sys
import socket
import re
import time
import datetime
import errno
def timestamp():
return datetime.datetime.now().strftime("[%H:%M:%S]")
class IRCClient:
def __init__(self, address, port, nick, username, realname):
self.connected = False
self.active_session = Fal... | false | true |
f751c602572c9caa28cc7aa44badb480c8d08b85 | 123,187 | py | Python | kivy/uix/textinput.py | tamo/kivy | f1a4b002b2150e466c4908a27cc1977dd083d19a | [
"MIT"
] | null | null | null | kivy/uix/textinput.py | tamo/kivy | f1a4b002b2150e466c4908a27cc1977dd083d19a | [
"MIT"
] | null | null | null | kivy/uix/textinput.py | tamo/kivy | f1a4b002b2150e466c4908a27cc1977dd083d19a | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
'''
Text Input
==========
.. versionadded:: 1.0.4
.. image:: images/textinput-mono.jpg
.. image:: images/textinput-multi.jpg
The :class:`TextInput` widget provides a box for editable plain text.
Unicode, multiline, cursor navigation, selection and clipboard features
are supported.
The :cl... | 35.8623 | 79 | 0.576944 |
__all__ = ('TextInput', )
import re
import sys
from os import environ
from weakref import ref
from kivy.animation import Animation
from kivy.base import EventLoop
from kivy.cache import Cache
from kivy.clock import Clock
from kivy.config import Config
from kivy.metrics import inch
from kivy.utils import boundary, ... | true | true |
f751c634a9d50106d1954cacfe7e08c5dfe5bb74 | 2,489 | py | Python | client/team08/prueba.py | mr8ug/tytus | a09abe4095e49d333a8ed9ca81cb3d88f90872ba | [
"MIT"
] | 1 | 2021-01-09T05:32:35.000Z | 2021-01-09T05:32:35.000Z | client/team08/prueba.py | XiomRB/tytus | 0873e4bdce5c110bee6ef2aa98240be6a93ae024 | [
"MIT"
] | null | null | null | client/team08/prueba.py | XiomRB/tytus | 0873e4bdce5c110bee6ef2aa98240be6a93ae024 | [
"MIT"
] | null | null | null | from tkinter import ttk
import tkinter as tk
from tkinter import *
import tkinter.scrolledtext as tkscrolled
# pip install pillow
from PIL import ImageTk, Image
class base:
#esto es un constructor
def __init__(self, window):
self.wind = window #guarda la ventana que tiene como parametro
self.... | 35.557143 | 92 | 0.625954 | from tkinter import ttk
import tkinter as tk
from tkinter import *
import tkinter.scrolledtext as tkscrolled
from PIL import ImageTk, Image
class base:
def __init__(self, window):
self.wind = window self.wind.title('TytusDB')
load = Image.open("icondb.jpg")
self.wind.iconphoto(F... | true | true |
f751c83f615cc58d491aa3bb04a7f6e2b6303b9f | 922 | py | Python | setup.py | AuthenticExecution/reactive-uart2ip | abd39c945051a9a79bcc19287c44b92ddbd891c3 | [
"MIT"
] | null | null | null | setup.py | AuthenticExecution/reactive-uart2ip | abd39c945051a9a79bcc19287c44b92ddbd891c3 | [
"MIT"
] | null | null | null | setup.py | AuthenticExecution/reactive-uart2ip | abd39c945051a9a79bcc19287c44b92ddbd891c3 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("requirements.txt", "r") as f:
requirements = f.readlines()
setup(
name='reactive-uart2ip',
version='0.2',
author="Gianluca Scopelliti",
author_email="gianlu... | 30.733333 | 69 | 0.672451 | from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("requirements.txt", "r") as f:
requirements = f.readlines()
setup(
name='reactive-uart2ip',
version='0.2',
author="Gianluca Scopelliti",
author_email="gianlu... | true | true |
f751c8d75588a12408982a63580db10ce0512b19 | 14,518 | py | Python | src/patteRNA/arglib.py | AviranLab/patteRNA | 88b900844016717a71b6ec8e4f2d10d8888600ce | [
"BSD-2-Clause"
] | 12 | 2018-03-02T21:48:46.000Z | 2022-01-31T02:58:59.000Z | src/patteRNA/arglib.py | AviranLab/patteRNA | 88b900844016717a71b6ec8e4f2d10d8888600ce | [
"BSD-2-Clause"
] | 2 | 2018-07-19T01:11:11.000Z | 2019-04-08T23:54:08.000Z | src/patteRNA/arglib.py | AviranLab/patteRNA | 88b900844016717a71b6ec8e4f2d10d8888600ce | [
"BSD-2-Clause"
] | 5 | 2018-03-06T18:13:36.000Z | 2021-01-08T20:54:28.000Z | """Parse and handle input arguments"""
import argparse
import logging
import multiprocessing
from patteRNA import version
logger = logging.getLogger(__name__)
def parse_cl_args(inputargs):
"""
Parse command line arguments.
Args:
inputargs (list): List of input arguments.
Returns:
in... | 45.798107 | 120 | 0.543601 |
import argparse
import logging
import multiprocessing
from patteRNA import version
logger = logging.getLogger(__name__)
def parse_cl_args(inputargs):
parser = argparse.ArgumentParser(prog="patteRNA",
description="Rapid mining of RNA secondary structure motifs from profiling ... | true | true |
f751ca1c2c494573277faa6b0bb58a51c90d3852 | 8,819 | py | Python | sdk/python/pulumi_azure_native/authorization/v20190101/policy_definition.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/authorization/v20190101/policy_definition.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/authorization/v20190101/policy_definition.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 47.929348 | 1,824 | 0.671391 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ._enums import *
__all__ = ['PolicyDefinition']
class PolicyDefinition(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
... | true | true |
f751cb435c9b435bf07934a32901cd6db7dc74ad | 8,025 | py | Python | fw/nodemcu-firmware/sdk/esp_iot_sdk_v1.4.0/tools/gen_appbin.py | tasdomas/nodemcu-build | 482698a135c787aa62e54776e75540d62f150cf2 | [
"MIT"
] | 6 | 2019-02-16T17:02:33.000Z | 2020-05-24T20:45:52.000Z | fw/nodemcu-firmware/sdk/esp_iot_sdk_v1.4.0/tools/gen_appbin.py | tasdomas/nodemcu-build | 482698a135c787aa62e54776e75540d62f150cf2 | [
"MIT"
] | null | null | null | fw/nodemcu-firmware/sdk/esp_iot_sdk_v1.4.0/tools/gen_appbin.py | tasdomas/nodemcu-build | 482698a135c787aa62e54776e75540d62f150cf2 | [
"MIT"
] | 4 | 2016-05-18T23:16:13.000Z | 2022-02-20T20:14:57.000Z | #!/usr/bin/python
#
# File : gen_appbin.py
# This file is part of Espressif's generate bin script.
# Copyright (C) 2013 - 2016, Espressif Systems
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of version 3 of the GNU General Public License as
# published by the Free Softwa... | 29.288321 | 179 | 0.584922 | # Copyright (C) 2013 - 2016, Espressif Systems
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of version 3 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT AN... | false | true |
f751cb8f1fd4d700d8c238e70a78c5f09a78ce3e | 90 | py | Python | cdhweb/blog/apps.py | bwhicks/cdh-web | d6002dc1933a4d6e97f5459aafc9ab92cb1f8050 | [
"Apache-2.0"
] | 1 | 2017-11-21T16:02:33.000Z | 2017-11-21T16:02:33.000Z | cdhweb/blog/apps.py | bwhicks/cdh-web | d6002dc1933a4d6e97f5459aafc9ab92cb1f8050 | [
"Apache-2.0"
] | 367 | 2017-08-14T16:05:41.000Z | 2021-11-03T15:29:18.000Z | cdhweb/blog/apps.py | bwhicks/cdh-web | d6002dc1933a4d6e97f5459aafc9ab92cb1f8050 | [
"Apache-2.0"
] | 5 | 2017-09-08T21:08:49.000Z | 2020-10-02T04:39:37.000Z | from django.apps import AppConfig
class BlogConfig(AppConfig):
name = "cdhweb.blog"
| 15 | 33 | 0.744444 | from django.apps import AppConfig
class BlogConfig(AppConfig):
name = "cdhweb.blog"
| true | true |
f751cb92608e963cc8e127bca967eb7b673ec879 | 3,037 | py | Python | chainer/functions/pooling/pooling_2d.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | chainer/functions/pooling/pooling_2d.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | chainer/functions/pooling/pooling_2d.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | import collections
import numpy
from chainer import cuda
from chainer import function
from chainer.utils import conv
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cudnn.cudnn
_cudnn_version = libcudnn.getVersion()
def _check_cudnn_acceptable_type(x_dtype):
... | 30.37 | 69 | 0.618703 | import collections
import numpy
from chainer import cuda
from chainer import function
from chainer.utils import conv
from chainer.utils import type_check
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn = cudnn.cudnn
_cudnn_version = libcudnn.getVersion()
def _check_cudnn_acceptable_type(x_dtype):
... | true | true |
f751cbd0cb72e74c3c5456265f821d05ece6a6f9 | 543 | py | Python | src/deepnox/utils/oop.py | deepnox-io/python-wipbox | cd919ddb551b0b80f0c162c2d5e99a0ba6c81bba | [
"MIT"
] | 2 | 2022-01-19T11:31:35.000Z | 2022-01-19T11:50:07.000Z | src/deepnox/utils/oop.py | deepnox-io/python-wipbox | cd919ddb551b0b80f0c162c2d5e99a0ba6c81bba | [
"MIT"
] | 3 | 2022-01-20T04:26:44.000Z | 2022-03-22T02:03:49.000Z | src/deepnox/utils/oop.py | deepnox-io/python-wipbox | cd919ddb551b0b80f0c162c2d5e99a0ba6c81bba | [
"MIT"
] | null | null | null |
class SingletonMeta(type):
"""
A metaclass to use other classes as singleton.
:see: https://www.datacamp.com/community/tutorials/python-metaclasses
"""
_instances = {}
""" A {dict} containing classes which must be a singleton. """
def __call__(cls, *args, **kwargs):
"""
... | 24.681818 | 84 | 0.589319 |
class SingletonMeta(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(SingletonMeta,cls).__call__(*args, **kwargs)
return cls._instances[cls]
| true | true |
f751cc169ec6fea1a69745da415a1890521e847d | 132 | py | Python | day06(python)/test.py | DreamLose/python- | 865249d7dba1fb1452189bde59c378aab8c99c9b | [
"MIT"
] | 1 | 2020-11-12T01:37:20.000Z | 2020-11-12T01:37:20.000Z | day06(python)/test.py | DreamLose/python- | 865249d7dba1fb1452189bde59c378aab8c99c9b | [
"MIT"
] | null | null | null | day06(python)/test.py | DreamLose/python- | 865249d7dba1fb1452189bde59c378aab8c99c9b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf8 -*- //Python2中 只要有中文头部就需要添加
n = input('请输入用户名: ')
n2 = input('请输入密码: ')
print(n)
print(n2) | 22 | 47 | 0.621212 | n = input('请输入用户名: ')
n2 = input('请输入密码: ')
print(n)
print(n2) | true | true |
f751cd1b36db612b80b3fcc4f0b2f250a04bfad4 | 96,833 | py | Python | test/functional/p2p_segwit.py | mrheat/doichain-core-rebase | 975aa7d438dbdb0baf352299afb3daf70318d37b | [
"MIT"
] | null | null | null | test/functional/p2p_segwit.py | mrheat/doichain-core-rebase | 975aa7d438dbdb0baf352299afb3daf70318d37b | [
"MIT"
] | null | null | null | test/functional/p2p_segwit.py | mrheat/doichain-core-rebase | 975aa7d438dbdb0baf352299afb3daf70318d37b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test segwit transactions and blocks on P2P network."""
from decimal import Decimal
import random
import... | 46.464971 | 187 | 0.653362 | from decimal import Decimal
import random
import struct
import time
from test_framework.blocktools import (
WITNESS_COMMITMENT_HEADER,
add_witness_commitment,
create_block,
create_coinbase,
)
from test_framework.key import ECKey
from test_framework.messages import (
BIP125_SEQUENCE_NUMBER,
CBlo... | true | true |
f751cdb7037a725701d6b350f3c0667cba5ccd6c | 1,296 | py | Python | airbyte-integrations/connectors/source-iterable/main.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 2 | 2021-03-02T09:17:41.000Z | 2021-03-02T11:02:23.000Z | airbyte-integrations/connectors/source-iterable/main.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 52 | 2021-06-11T12:39:05.000Z | 2022-03-30T04:59:35.000Z | airbyte-integrations/connectors/source-iterable/main.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 2 | 2021-12-14T17:15:40.000Z | 2021-12-14T17:18:03.000Z | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pu... | 38.117647 | 80 | 0.771605 |
import sys
from airbyte_cdk.entrypoint import launch
from source_iterable import SourceIterable
if __name__ == "__main__":
source = SourceIterable()
launch(source, sys.argv[1:])
| true | true |
f751cf6b8c455e5b542f809f64aac37a76b0b5de | 4,098 | py | Python | scanpy/preprocessing/_normalization.py | dhb2128/scanpy | 78649a991197af4685a8fe2f7a0d24064e3056bd | [
"BSD-3-Clause"
] | null | null | null | scanpy/preprocessing/_normalization.py | dhb2128/scanpy | 78649a991197af4685a8fe2f7a0d24064e3056bd | [
"BSD-3-Clause"
] | null | null | null | scanpy/preprocessing/_normalization.py | dhb2128/scanpy | 78649a991197af4685a8fe2f7a0d24064e3056bd | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from scipy.sparse import issparse
from sklearn.utils import sparsefuncs
from .. import logging as logg
from ..utils import doc_params
from ._docs import doc_norm_descr, doc_quant_descr, doc_params_bulk, doc_norm_quant, doc_norm_return, doc_ex_quant, doc_ex_total
def _normalize_data(X, counts, after=... | 33.590164 | 128 | 0.638848 | import numpy as np
from scipy.sparse import issparse
from sklearn.utils import sparsefuncs
from .. import logging as logg
from ..utils import doc_params
from ._docs import doc_norm_descr, doc_quant_descr, doc_params_bulk, doc_norm_quant, doc_norm_return, doc_ex_quant, doc_ex_total
def _normalize_data(X, counts, after=... | true | true |
f751cf93baf60ffd406b9540688f6edcc64fb6d9 | 6,615 | py | Python | src/run.py | D3v01dZA/sawnee-reader | 5ae459c4b834b4faf9f8b46162ef9cb6cd7bd7ba | [
"MIT"
] | null | null | null | src/run.py | D3v01dZA/sawnee-reader | 5ae459c4b834b4faf9f8b46162ef9cb6cd7bd7ba | [
"MIT"
] | null | null | null | src/run.py | D3v01dZA/sawnee-reader | 5ae459c4b834b4faf9f8b46162ef9cb6cd7bd7ba | [
"MIT"
] | null | null | null | import logging
import mqtt
import argparse
import yaml
import sawnee
import repeat
import datetime
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
logging.basicConfi... | 42.954545 | 156 | 0.687377 | import logging
import mqtt
import argparse
import yaml
import sawnee
import repeat
import datetime
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
logging.basicConfi... | true | true |
f751cfbababba19cb05c08ea0435751daadb987c | 541 | py | Python | tfc_web/transport/migrations/0015_vehiclejourney_timetable.py | SmartCambridge/tfc_web | ac16b3c2aa5200320e9ffa9d270fb409b98ed55d | [
"MIT"
] | 2 | 2018-10-28T20:15:23.000Z | 2019-03-29T09:06:09.000Z | tfc_web/transport/migrations/0015_vehiclejourney_timetable.py | SmartCambridge/tfc_web | ac16b3c2aa5200320e9ffa9d270fb409b98ed55d | [
"MIT"
] | 107 | 2018-10-22T06:57:07.000Z | 2020-09-15T14:43:03.000Z | tfc_web/transport/migrations/0015_vehiclejourney_timetable.py | SmartCambridge/tfc_web | ac16b3c2aa5200320e9ffa9d270fb409b98ed55d | [
"MIT"
] | 1 | 2020-03-20T19:49:29.000Z | 2020-03-20T19:49:29.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-04 19:53
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('transport', '0014_line_rendered_timetable'),
]
... | 24.590909 | 88 | 0.659889 | from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('transport', '0014_line_rendered_timetable'),
]
operations = [
migrations.AddField(
model_name='vehic... | true | true |
f751d0d18b480e1e35b78ba298741039bf953b4d | 18,363 | py | Python | models_all_solvable2/smallinvDAXr3b100-110.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | 7 | 2019-05-08T19:14:34.000Z | 2021-12-24T00:00:40.000Z | models_all_solvable2/smallinvDAXr3b100-110.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | null | null | null | models_all_solvable2/smallinvDAXr3b100-110.py | grossmann-group/pyomo-MINLP-benchmarking | 714f0a0dffd61675649a805683c0627af6b4929e | [
"MIT"
] | 2 | 2020-05-21T22:15:51.000Z | 2020-06-02T23:02:08.000Z | # MINLP written by GAMS Convert at 05/15/20 00:51:19
#
# Equation counts
# Total E G L N X C B
# 4 0 2 2 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 94.169231 | 120 | 0.541687 |
from pyomo.environ import *
model = m = ConcreteModel()
m.i1 = Var(within=Integers,bounds=(0,100),initialize=0)
m.i2 = Var(within=Integers,bounds=(0,100),initialize=0)
m.i3 = Var(within=Integers,bounds=(0,100),initialize=0)
m.i4 = Var(within=Integers,bounds=(0,100),initialize=0)
m.i5 = Var(within=Integers,bounds=(... | true | true |
f751d1bcf1af5b89b20d0ba4e9699e9224dd0f05 | 2,727 | py | Python | tests/deprecated/check.py | constantinpape/mc_luigi | c8dac84ace7d422f7ec25d722204b25d625c84e1 | [
"MIT"
] | null | null | null | tests/deprecated/check.py | constantinpape/mc_luigi | c8dac84ace7d422f7ec25d722204b25d625c84e1 | [
"MIT"
] | null | null | null | tests/deprecated/check.py | constantinpape/mc_luigi | c8dac84ace7d422f7ec25d722204b25d625c84e1 | [
"MIT"
] | null | null | null | from volumina_viewer import volumina_n_layer
import vigra
import json
import os
import numpy as np
def check_train_cache(sample):
cache_folder = '/home/constantin/Work/home_hdd/cache/regression_tests_mcluigi/%s' % sample
for ff in os.listdir(cache_folder):
if ff.startswith("EdgeGroundtruth"):
... | 28.705263 | 137 | 0.644664 | from volumina_viewer import volumina_n_layer
import vigra
import json
import os
import numpy as np
def check_train_cache(sample):
cache_folder = '/home/constantin/Work/home_hdd/cache/regression_tests_mcluigi/%s' % sample
for ff in os.listdir(cache_folder):
if ff.startswith("EdgeGroundtruth"):
... | false | true |
f751d33f1b2fbc5857f24c93d7939bb044b5c83a | 83 | py | Python | scaelum/runner/__init__.py | fedorados/SkyComputing | a626a62de9505db7397a2c5096010089dba1d0d5 | [
"Apache-2.0"
] | 53 | 2022-02-25T03:11:03.000Z | 2022-03-23T01:01:24.000Z | scaelum/runner/__init__.py | fedorados/SkyComputing | a626a62de9505db7397a2c5096010089dba1d0d5 | [
"Apache-2.0"
] | 1 | 2022-02-28T16:53:01.000Z | 2022-02-28T16:53:01.000Z | scaelum/runner/__init__.py | fedorados/SkyComputing | a626a62de9505db7397a2c5096010089dba1d0d5 | [
"Apache-2.0"
] | 15 | 2022-02-25T03:07:21.000Z | 2022-03-03T02:55:59.000Z | from .hooks import Hook
from .hooks_collection import *
from .runner import Runner
| 20.75 | 31 | 0.807229 | from .hooks import Hook
from .hooks_collection import *
from .runner import Runner
| true | true |
f751d38c14f43d992b87902fd68a9970867e86a9 | 342 | py | Python | portalocker_tests/conftest.py | lkindrat-xmos/portalocker | 0e5da0568bdeb9efeffed1c66d167d83aa06735e | [
"PSF-2.0"
] | 172 | 2015-02-26T07:32:30.000Z | 2022-03-07T15:49:43.000Z | portalocker_tests/conftest.py | lkindrat-xmos/portalocker | 0e5da0568bdeb9efeffed1c66d167d83aa06735e | [
"PSF-2.0"
] | 71 | 2015-09-19T09:25:03.000Z | 2022-03-11T07:41:48.000Z | portalocker_tests/conftest.py | lkindrat-xmos/portalocker | 0e5da0568bdeb9efeffed1c66d167d83aa06735e | [
"PSF-2.0"
] | 33 | 2015-05-06T23:41:44.000Z | 2022-02-16T18:37:02.000Z | import py
import logging
import pytest
logger = logging.getLogger(__name__)
@pytest.fixture
def tmpfile(tmpdir_factory):
tmpdir = tmpdir_factory.mktemp('temp')
filename = tmpdir.join('tmpfile')
yield str(filename)
try:
filename.remove(ignore_errors=True)
except (py.error.EBUSY, py.error.... | 19 | 45 | 0.701754 | import py
import logging
import pytest
logger = logging.getLogger(__name__)
@pytest.fixture
def tmpfile(tmpdir_factory):
tmpdir = tmpdir_factory.mktemp('temp')
filename = tmpdir.join('tmpfile')
yield str(filename)
try:
filename.remove(ignore_errors=True)
except (py.error.EBUSY, py.error.... | true | true |
f751d3a60b39dcea92107666186702d866c42654 | 33,690 | py | Python | plag.py | reachwire/antiplagiarism | 0ce16cca515262822e7621c4f5554cc354dd2874 | [
"MIT"
] | null | null | null | plag.py | reachwire/antiplagiarism | 0ce16cca515262822e7621c4f5554cc354dd2874 | [
"MIT"
] | null | null | null | plag.py | reachwire/antiplagiarism | 0ce16cca515262822e7621c4f5554cc354dd2874 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import fnmatch
import fulltext
import os
from flask import Flask, request, render_template, redirect, url_for, send_from_directory, jsonify
from werkzeug.utils import secure_filename
from werkzeug import SharedDataMiddleware
import re
import math
import time
import json
import shinglmethods
imp... | 52.640625 | 192 | 0.552657 |
import fnmatch
import fulltext
import os
from flask import Flask, request, render_template, redirect, url_for, send_from_directory, jsonify
from werkzeug.utils import secure_filename
from werkzeug import SharedDataMiddleware
import re
import math
import time
import json
import shinglmethods
import shinglmethods_sorted... | true | true |
f751d43a816ec601bc5fa84c7b9472b3a4d90154 | 54,301 | py | Python | test/orm/test_merge.py | balabit-deps/balabit-os-7-sqlalchemy | 3b20b55f46f258a11811bd8f3af8958393ee21a2 | [
"MIT"
] | 1 | 2018-04-02T18:41:52.000Z | 2018-04-02T18:41:52.000Z | test/orm/test_merge.py | balabit-deps/balabit-os-7-sqlalchemy | 3b20b55f46f258a11811bd8f3af8958393ee21a2 | [
"MIT"
] | null | null | null | test/orm/test_merge.py | balabit-deps/balabit-os-7-sqlalchemy | 3b20b55f46f258a11811bd8f3af8958393ee21a2 | [
"MIT"
] | 3 | 2017-09-26T13:59:24.000Z | 2020-12-04T17:51:54.000Z | from sqlalchemy.testing import assert_raises_message
import sqlalchemy as sa
from sqlalchemy import Integer, PickleType, String, ForeignKey, Text
import operator
from sqlalchemy import testing
from sqlalchemy.util import OrderedSet
from sqlalchemy.orm import mapper, relationship, create_session, \
PropComparator, s... | 32.989672 | 79 | 0.534392 | from sqlalchemy.testing import assert_raises_message
import sqlalchemy as sa
from sqlalchemy import Integer, PickleType, String, ForeignKey, Text
import operator
from sqlalchemy import testing
from sqlalchemy.util import OrderedSet
from sqlalchemy.orm import mapper, relationship, create_session, \
PropComparator, s... | true | true |
f751d520739a6801304f3bf5319e2f644e5758e1 | 4,251 | py | Python | slider-agent/src/main/python/resource_management/core/resources/system.py | turningme/incubator-retired-slider | 1d4f519d763210f46e327338be72efa99e65cb5d | [
"Apache-2.0"
] | 60 | 2015-01-05T10:51:11.000Z | 2018-12-15T03:48:09.000Z | slider-agent/src/main/python/resource_management/core/resources/system.py | turningme/incubator-retired-slider | 1d4f519d763210f46e327338be72efa99e65cb5d | [
"Apache-2.0"
] | null | null | null | slider-agent/src/main/python/resource_management/core/resources/system.py | turningme/incubator-retired-slider | 1d4f519d763210f46e327338be72efa99e65cb5d | [
"Apache-2.0"
] | 87 | 2015-01-14T05:14:15.000Z | 2018-12-25T14:14:56.000Z | #!/usr/bin/env python
"""
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");... | 31.488889 | 105 | 0.733945 |
__all__ = ["File", "Directory", "Link", "Execute", "ExecuteScript", "Mount"]
from resource_management.core.base import Resource, ForcedListArgument, ResourceArgument, BooleanArgument
class File(Resource):
action = ForcedListArgument(default="create")
path = ResourceArgument(default=lambda obj: obj.name)
backu... | true | true |
f751d5344fbcaab8ae9e71c40c5a0709238b8bdd | 665 | py | Python | hello_world.py | ucrgradquant/ucr_python_seminar | cc3988aac334abf5cf1861da0770cd6c63784bf2 | [
"Apache-2.0"
] | null | null | null | hello_world.py | ucrgradquant/ucr_python_seminar | cc3988aac334abf5cf1861da0770cd6c63784bf2 | [
"Apache-2.0"
] | null | null | null | hello_world.py | ucrgradquant/ucr_python_seminar | cc3988aac334abf5cf1861da0770cd6c63784bf2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2009-2013 by The Regents of the University of California
# 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 from
#
# http://www.apache.org/licenses/LICENSE-2.... | 36.944444 | 74 | 0.757895 |
print "Hello World!"
| false | true |
f751d68e2e171300c8765ee2154ddfad7399c874 | 648 | py | Python | src/29.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | 12 | 2016-10-19T09:03:20.000Z | 2021-01-10T10:53:23.000Z | src/29.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | null | null | null | src/29.py | cloudzfy/euler | b82efad753ee98375fd40ec4e3989be57828e82c | [
"MIT"
] | 6 | 2018-09-12T03:13:58.000Z | 2021-07-07T00:29:43.000Z | # Consider all integer combinations of ab for 2 <= a <= 5 and 2 <= b <= 5:
# 2^2 = 4, 2^3 = 8, 2^4 = 16, 2^5 = 32
# 3^2 = 9, 3^3 = 27, 3^4 = 81, 3^5 = 243
# 4^2 = 16, 4^3 = 64, 4^4 = 256, 4^5 = 1024
# 5^2 = 25, 5^3 = 125, 5^4 = 625, 5^5 = 3125
# If they are then placed in numerical order, with any repeats removed, we ... | 29.454545 | 79 | 0.58179 |
nums = []
for a in range(2, 101):
for b in range(2, 101):
nums.append(pow(a, b))
print len(set(nums))
| false | true |
f751d75998209208bfac94e6c11e7a3bc2cbb330 | 2,403 | py | Python | pymtl3/passes/backends/yosys/test/TranslationImport_closed_loop_component_test.py | kevinyuan/pymtl3 | 5949e6a4acc625c0ccbbb25be3af1d0db683df3c | [
"BSD-3-Clause"
] | 152 | 2020-06-03T02:34:11.000Z | 2022-03-30T04:16:45.000Z | pymtl3/passes/backends/yosys/test/TranslationImport_closed_loop_component_test.py | kevinyuan/pymtl3 | 5949e6a4acc625c0ccbbb25be3af1d0db683df3c | [
"BSD-3-Clause"
] | 139 | 2019-05-29T00:37:09.000Z | 2020-05-17T16:49:26.000Z | pymtl3/passes/backends/yosys/test/TranslationImport_closed_loop_component_test.py | kevinyuan/pymtl3 | 5949e6a4acc625c0ccbbb25be3af1d0db683df3c | [
"BSD-3-Clause"
] | 22 | 2020-05-18T13:42:05.000Z | 2022-03-11T08:37:51.000Z | #=========================================================================
# TranslationImport_closed_loop_component_test.py
#=========================================================================
# Author : Peitian Pan
# Date : June 6, 2019
"""Closed-loop test cases for translation-import with component."""
impor... | 37.546875 | 87 | 0.717437 | import pytest
from hypothesis import HealthCheck, given, reproduce_failure, settings
from hypothesis import strategies as st
from pymtl3.datatypes import Bits1, Bits16, Bits32, bitstruct, clog2, mk_bits
from pymtl3.dsl import Component, InPort, Interface, OutPort, Wire, connect
from pymtl3.passes.backends.verilog.util... | true | true |
f751d76698e8ae306b996a273dc94e8ba599b637 | 260 | py | Python | dunm_sandbox/myapp/migrations/0004_merge_20200502_0148.py | lorinkoz/django-unmigrate | 8b5d887e4dbcaadf84b1e0d6899e57ee437ad794 | [
"MIT"
] | 65 | 2020-04-29T05:54:43.000Z | 2021-11-03T15:13:50.000Z | dunm_sandbox/myapp/migrations/0004_merge_20200502_0148.py | lorinkoz/django-unmigrate | 8b5d887e4dbcaadf84b1e0d6899e57ee437ad794 | [
"MIT"
] | 14 | 2020-04-29T05:55:49.000Z | 2021-04-28T19:34:26.000Z | dunm_sandbox/myapp/migrations/0004_merge_20200502_0148.py | lorinkoz/django-unmigrate | 8b5d887e4dbcaadf84b1e0d6899e57ee437ad794 | [
"MIT"
] | 4 | 2020-05-06T16:47:49.000Z | 2020-09-04T08:23:40.000Z | # Generated by Django 3.0.5 on 2020-05-02 01:48
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("myapp", "0003_mymodel_is_paid"),
("myapp", "0003_mymodel_is_active"),
]
operations = []
| 18.571429 | 47 | 0.65 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("myapp", "0003_mymodel_is_paid"),
("myapp", "0003_mymodel_is_active"),
]
operations = []
| true | true |
f751d7d4d8375796799929aec1089f141c3457a1 | 864 | py | Python | tests/test_calculations/base_test.py | vahndi/probability | 6ddf88e6f3d947c96b879e426030f60eb5cb2d59 | [
"MIT"
] | 2 | 2020-02-21T00:47:03.000Z | 2020-09-22T19:00:48.000Z | tests/test_calculations/base_test.py | vahndi/probability | 6ddf88e6f3d947c96b879e426030f60eb5cb2d59 | [
"MIT"
] | 52 | 2020-01-16T16:05:08.000Z | 2022-02-24T15:10:10.000Z | tests/test_calculations/base_test.py | vahndi/probability | 6ddf88e6f3d947c96b879e426030f60eb5cb2d59 | [
"MIT"
] | null | null | null | from unittest.case import TestCase
from pandas import Series, DataFrame
from probability.distributions import Beta, Dirichlet
class BaseTest(TestCase):
def setUp(self) -> None:
self.b1 = Beta(700, 300)
self.b2 = Beta(600, 400)
self.b3 = Beta(500, 500)
self.d1 = Dirichlet([500, ... | 30.857143 | 62 | 0.555556 | from unittest.case import TestCase
from pandas import Series, DataFrame
from probability.distributions import Beta, Dirichlet
class BaseTest(TestCase):
def setUp(self) -> None:
self.b1 = Beta(700, 300)
self.b2 = Beta(600, 400)
self.b3 = Beta(500, 500)
self.d1 = Dirichlet([500, ... | true | true |
f751d7ed198ba4587c0b3d54ff3e284c87c58537 | 7,979 | py | Python | tensorflow_probability/python/bijectors/affine_scalar_test.py | trainorpj/probability | 944272707d352b12b91c419082fb3ec34b83b494 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/affine_scalar_test.py | trainorpj/probability | 944272707d352b12b91c419082fb3ec34b83b494 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/affine_scalar_test.py | trainorpj/probability | 944272707d352b12b91c419082fb3ec34b83b494 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 37.995238 | 95 | 0.676651 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow.compat.v1 as tf1
import tensorflow.compat.v2 as tf
from tensorflow_probability.python import bijectors as tfb
from tensorflow_probability.python.bijectors import bijector_... | true | true |
f751d8127d7906b59e82cc5649a3736e76034c2c | 19,905 | py | Python | opensfm/exif.py | ixonos/OpenSfM | f20519f770db8161fefca6f40ac9198daa7b832e | [
"BSD-2-Clause"
] | null | null | null | opensfm/exif.py | ixonos/OpenSfM | f20519f770db8161fefca6f40ac9198daa7b832e | [
"BSD-2-Clause"
] | null | null | null | opensfm/exif.py | ixonos/OpenSfM | f20519f770db8161fefca6f40ac9198daa7b832e | [
"BSD-2-Clause"
] | null | null | null | from __future__ import division
import datetime
import exifread
import logging
import xmltodict as x2d
from codecs import encode, decode
from six import string_types
from opensfm.sensors import sensor_data
from opensfm import types
from opensfm import pygeometry
logger = logging.getLogger(__name__)
inch_in_mm = 2... | 35.418149 | 98 | 0.555991 | from __future__ import division
import datetime
import exifread
import logging
import xmltodict as x2d
from codecs import encode, decode
from six import string_types
from opensfm.sensors import sensor_data
from opensfm import types
from opensfm import pygeometry
logger = logging.getLogger(__name__)
inch_in_mm = 2... | true | true |
f751d87eaf1462ff619bf215f5c8932254aa6828 | 1,224 | py | Python | rl_safety_algorithms/algs/cpo/defaults.py | liuzuxin/RL-Safety-Algorithms | 2575225b1ea8ce12e1e13f7a81f8dda7b4189708 | [
"MIT"
] | 4 | 2021-09-05T17:49:02.000Z | 2021-12-22T03:13:39.000Z | rl_safety_algorithms/algs/cpo/defaults.py | liuzuxin/RL-Safety-Algorithms | 2575225b1ea8ce12e1e13f7a81f8dda7b4189708 | [
"MIT"
] | null | null | null | rl_safety_algorithms/algs/cpo/defaults.py | liuzuxin/RL-Safety-Algorithms | 2575225b1ea8ce12e1e13f7a81f8dda7b4189708 | [
"MIT"
] | 2 | 2021-09-05T17:49:07.000Z | 2021-11-30T17:36:30.000Z | def defaults():
return dict(
actor='mlp',
ac_kwargs={
'pi': {'hidden_sizes': (64, 64),
'activation': 'tanh'},
'val': {'hidden_sizes': (64, 64),
'activation': 'tanh'}
},
adv_estimation_method='gae',
epochs=300, # ... | 27.818182 | 74 | 0.594771 | def defaults():
return dict(
actor='mlp',
ac_kwargs={
'pi': {'hidden_sizes': (64, 64),
'activation': 'tanh'},
'val': {'hidden_sizes': (64, 64),
'activation': 'tanh'}
},
adv_estimation_method='gae',
epochs=300, ... | true | true |
f751d8f243599cf76fac7c704ca7bde9d32f412f | 5,138 | py | Python | src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/custom.py | diberry/azure-cli | 302999245cbb13b890b0a74f03443c577bd4bfae | [
"MIT"
] | 1 | 2019-03-30T20:49:32.000Z | 2019-03-30T20:49:32.000Z | src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/custom.py | diberry/azure-cli | 302999245cbb13b890b0a74f03443c577bd4bfae | [
"MIT"
] | 4 | 2018-08-08T20:01:17.000Z | 2018-09-17T15:20:06.000Z | src/command_modules/azure-cli-cdn/azure/cli/command_modules/cdn/custom.py | diberry/azure-cli | 302999245cbb13b890b0a74f03443c577bd4bfae | [
"MIT"
] | 1 | 2018-04-14T01:46:00.000Z | 2018-04-14T01:46:00.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 41.435484 | 107 | 0.637602 |
from azure.mgmt.cdn.models import (Endpoint, SkuName,
EndpointUpdateParameters, ProfileUpdateParameters)
def default_content_types():
return ["text/plain",
"text/html",
"text/css",
"text/javascript",
"application/x-javascript",
... | true | true |
f751d94b52d94298573612d75675d0c143c5e330 | 1,744 | py | Python | run_qplib_problems.py | BerkeleyAutomation/rlqp_benchmarks | 5c79e870c4bd697383f66f5dff26aea29dc1ebfa | [
"Apache-2.0"
] | 49 | 2017-11-18T11:16:44.000Z | 2021-05-05T12:48:33.000Z | run_qplib_problems.py | leiyubiao/osqp_benchmarks | 5c79e870c4bd697383f66f5dff26aea29dc1ebfa | [
"Apache-2.0"
] | 5 | 2017-11-18T20:10:25.000Z | 2020-09-27T09:06:58.000Z | run_qplib_problems.py | leiyubiao/osqp_benchmarks | 5c79e870c4bd697383f66f5dff26aea29dc1ebfa | [
"Apache-2.0"
] | 19 | 2017-11-18T20:13:31.000Z | 2021-05-06T01:27:31.000Z | '''
Run QPLIB problems for the OSQP paper
This code tests the solvers:
- OSQP
- GUROBI
- MOSEK
'''
from qplib_problems.qplib_problem import QPLIBRunner
import solvers.solvers as s
from utils.benchmark import compute_stats_info
import os
import argparse
parser = argparse.ArgumentParser(description='QPLIB... | 28.590164 | 85 | 0.696674 | from qplib_problems.qplib_problem import QPLIBRunner
import solvers.solvers as s
from utils.benchmark import compute_stats_info
import os
import argparse
parser = argparse.ArgumentParser(description='QPLIB Runner')
parser.add_argument('--high_accuracy', help='Test with high accuracy', default=False,
... | true | true |
f751d98d4ead7e46380170ae61425dc65e319559 | 545 | py | Python | simple-backend/manage.py | mylibrar/stave | 43145015253d0577dfc757419ad8b4fa06a04042 | [
"Apache-2.0"
] | 35 | 2020-01-29T04:21:10.000Z | 2021-12-13T01:44:28.000Z | simple-backend/manage.py | mylibrar/stave | 43145015253d0577dfc757419ad8b4fa06a04042 | [
"Apache-2.0"
] | 86 | 2020-04-17T16:36:13.000Z | 2022-03-25T22:51:34.000Z | simple-backend/manage.py | mylibrar/stave | 43145015253d0577dfc757419ad8b4fa06a04042 | [
"Apache-2.0"
] | 18 | 2020-02-04T17:40:02.000Z | 2021-06-17T07:11:42.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stave_backend.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django... | 34.0625 | 77 | 0.689908 | import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stave_backend.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's in... | true | true |
f751da9345be83cf17dc3c849a90118321dc9cf1 | 29,336 | py | Python | tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_feature_filter.py | yuanqingsunny/recommenders-addons | 7fe0e213ff59fe3528e7c1877a3885cc7ca355d4 | [
"Apache-2.0"
] | null | null | null | tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_feature_filter.py | yuanqingsunny/recommenders-addons | 7fe0e213ff59fe3528e7c1877a3885cc7ca355d4 | [
"Apache-2.0"
] | null | null | null | tensorflow_recommenders_addons/dynamic_embedding/python/ops/dynamic_feature_filter.py | yuanqingsunny/recommenders-addons | 7fe0e213ff59fe3528e7c1877a3885cc7ca355d4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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... | 36.900629 | 98 | 0.668496 |
from tensorflow_recommenders_addons import dynamic_embedding
from tensorflow_recommenders_addons.dynamic_embedding.python.ops import dynamic_embedding_variable
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow... | true | true |
f751dac6f896b9252d4175de0a968fb629b7091b | 14,849 | py | Python | UnityEngine/UI/Scrollbar/__init__.py | Grim-es/udon-pie-auto-completion | c2cd86554ed615cdbbb01e19fa40665eafdfaedc | [
"MIT"
] | null | null | null | UnityEngine/UI/Scrollbar/__init__.py | Grim-es/udon-pie-auto-completion | c2cd86554ed615cdbbb01e19fa40665eafdfaedc | [
"MIT"
] | null | null | null | UnityEngine/UI/Scrollbar/__init__.py | Grim-es/udon-pie-auto-completion | c2cd86554ed615cdbbb01e19fa40665eafdfaedc | [
"MIT"
] | null | null | null | from typing import overload
from UdonPie import System
from UdonPie import UnityEngine
from UdonPie.Undefined import *
class Scrollbar:
def __new__(cls, arg1=None):
'''
:returns: Scrollbar
:rtype: UnityEngine.UI.Scrollbar
'''
pass
@staticmethod
def op_Implicit(arg... | 20.120596 | 77 | 0.530675 | from typing import overload
from UdonPie import System
from UdonPie import UnityEngine
from UdonPie.Undefined import *
class Scrollbar:
def __new__(cls, arg1=None):
pass
@staticmethod
def op_Implicit(arg1):
pass
@staticmethod
def op_Equality(arg1, arg2):
pass
@stati... | true | true |
f751daddc82403380c8fcd3586e4812f41cf7acd | 5,888 | py | Python | global_vars.py | danielbi-ETHZ/THM-Econ | 1b668a523efbd7f18f0d833d0708540e4fe66602 | [
"MIT"
] | null | null | null | global_vars.py | danielbi-ETHZ/THM-Econ | 1b668a523efbd7f18f0d833d0708540e4fe66602 | [
"MIT"
] | null | null | null | global_vars.py | danielbi-ETHZ/THM-Econ | 1b668a523efbd7f18f0d833d0708540e4fe66602 | [
"MIT"
] | null | null | null | ################################################################################
######### © 2020 ETH Zurich, Institute of Geophysics, Daniel T. Birdsell #######
################################################################################
### Define global parameters using units of J, kg, C, s, m
### The notation ... | 60.081633 | 80 | 0.579314 |
rho_w = 1000; Cpw = 4186; T_WH = 90.; T_DH = 45.; geothermal_gradient = 30./1000. T_surf = 10; D = 0.311-0.05; viscosity = 0.0005; rho_r = 2500; Cpr = 850; porosity = 0.15; t_inj = 365.25*24*60*60/4. gravity = 9.81; reservoir_depth = 575; alphaI = 1.0 alphaII = 1.0 lambda_r = 3.0 lambda_w = 0.6; lambda... | true | true |
f751dcb9183dbc67ca493b16cd04003589c2ef3b | 17,161 | py | Python | virtual/bin/lib/bcc_chef_databags.py | ajaytikoo/chef-bcpc | dee00d3f96eddcb4972b151e6c31d6ecdb819796 | [
"Apache-2.0"
] | null | null | null | virtual/bin/lib/bcc_chef_databags.py | ajaytikoo/chef-bcpc | dee00d3f96eddcb4972b151e6c31d6ecdb819796 | [
"Apache-2.0"
] | null | null | null | virtual/bin/lib/bcc_chef_databags.py | ajaytikoo/chef-bcpc | dee00d3f96eddcb4972b151e6c31d6ecdb819796 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Bloomberg Finance L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wri... | 34.59879 | 93 | 0.460404 |
import base64
import os
import random
import secrets
import string
import struct
import subprocess
import time
import uuid
import yaml
from builtins import FileExistsError
from Crypto.PublicKey import RSA
from OpenSSL import crypto
class APISSL:
def __init__(self):
self.__key = crypto.PKey()
... | true | true |
f751dd848e989d79b177f4d0af80bb5294fa2165 | 31,580 | py | Python | neutron/tests/functional/agent/l3/framework.py | stackhpc/neutron | df94641b43964834ba14c69eb4fb17cc45349117 | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/agent/l3/framework.py | stackhpc/neutron | df94641b43964834ba14c69eb4fb17cc45349117 | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/agent/l3/framework.py | stackhpc/neutron | df94641b43964834ba14c69eb4fb17cc45349117 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 43.379121 | 79 | 0.632806 |
import copy
import functools
import os
from unittest import mock
import netaddr
from neutron_lib import constants
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import uuidutils
import testtools
from neutron.agent.common import ovs_lib
from neutron.agent.l3 import agent as neutron_l3... | true | true |
f751ddcec2c25022e7d861d883d733774c8b1642 | 7,422 | py | Python | concrete/cfg/anchors/cm_rcnn_10164_a10.py | forestriveral/mmdetection-for-concrete | 9e6573947b3541003e796190bad207f6d9f002de | [
"Apache-2.0"
] | null | null | null | concrete/cfg/anchors/cm_rcnn_10164_a10.py | forestriveral/mmdetection-for-concrete | 9e6573947b3541003e796190bad207f6d9f002de | [
"Apache-2.0"
] | null | null | null | concrete/cfg/anchors/cm_rcnn_10164_a10.py | forestriveral/mmdetection-for-concrete | 9e6573947b3541003e796190bad207f6d9f002de | [
"Apache-2.0"
] | 1 | 2021-08-10T09:07:01.000Z | 2021-08-10T09:07:01.000Z | # model settings
model = dict(
type='CascadeRCNN',
num_stages=3,
pretrained='open-mmlab://resnext101_64x4d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='... | 30.418033 | 95 | 0.540151 | model = dict(
type='CascadeRCNN',
num_stages=3,
pretrained='open-mmlab://resnext101_64x4d',
backbone=dict(
type='ResNeXt',
depth=101,
groups=64,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
style='pytorch'),
ne... | true | true |
f751de300191f6d628ecfc3c50bcb798423005c1 | 386 | py | Python | ch_09/task6.py | berchev/python_learning | 5b99065cade53c64b4ede3d0e583c58573ca654c | [
"MIT"
] | null | null | null | ch_09/task6.py | berchev/python_learning | 5b99065cade53c64b4ede3d0e583c58573ca654c | [
"MIT"
] | null | null | null | ch_09/task6.py | berchev/python_learning | 5b99065cade53c64b4ede3d0e583c58573ca654c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
text = ""
while text.lower() != "quit":
text = input("Please enter a chemical formula (or 'quit' to exit): ")
if text == "quit":
print("...exiting program")
elif text == "H2O":
print("Water")
elif text == "NH3":
print("Ammonia")
elif text == "CH4":
... | 22.705882 | 73 | 0.531088 |
text = ""
while text.lower() != "quit":
text = input("Please enter a chemical formula (or 'quit' to exit): ")
if text == "quit":
print("...exiting program")
elif text == "H2O":
print("Water")
elif text == "NH3":
print("Ammonia")
elif text == "CH4":
print("Methane")... | true | true |
f751e201cba3594c0c7fdc422f477b223d6e3fa1 | 3,087 | py | Python | leo/plugins/chapter_hoist.py | thomasbuttler/leo-editor | c1bddc31313b7788f0d6583dcb4ab75db73e9a09 | [
"MIT"
] | 1,550 | 2015-01-14T16:30:37.000Z | 2022-03-31T08:55:58.000Z | leo/plugins/chapter_hoist.py | thomasbuttler/leo-editor | c1bddc31313b7788f0d6583dcb4ab75db73e9a09 | [
"MIT"
] | 2,009 | 2015-01-13T16:28:52.000Z | 2022-03-31T18:21:48.000Z | leo/plugins/chapter_hoist.py | thomasbuttler/leo-editor | c1bddc31313b7788f0d6583dcb4ab75db73e9a09 | [
"MIT"
] | 200 | 2015-01-05T15:07:41.000Z | 2022-03-07T17:05:01.000Z | #@+leo-ver=5-thin
#@+node:ekr.20060328125925: * @file ../plugins/chapter_hoist.py
#@+<< docstring >>
#@+node:ekr.20060328125925.1: ** << docstring >>
""" Creates hoist buttons.
This plugin puts two buttons in the icon area: a button called 'Save Hoist' and
a button called 'Dehoist'. The 'Save Hoist' button hoists the ... | 31.181818 | 80 | 0.634597 |
from leo.core import leoGlobals as g
from leo.plugins.mod_scripting import scriptingController
def init ():
g.registerHandler(('new','open2'),onCreate)
g.plugin_signon(__name__)
return True
def onCreate (tag, keys):
c = keys.get('c')
if c:
sc = scriptingController(c)
chapt... | true | true |
f751e2936b69634ba0d3f39b81e6cd56b4294d47 | 8,550 | py | Python | tests/modeling/test_optimizer.py | sstsai-adl/d2go | 6cff773797b14698043589afe57ea67cd76286f9 | [
"Apache-2.0"
] | 687 | 2021-03-03T07:50:15.000Z | 2022-03-25T19:31:57.000Z | tests/modeling/test_optimizer.py | sstsai-adl/d2go | 6cff773797b14698043589afe57ea67cd76286f9 | [
"Apache-2.0"
] | 193 | 2021-03-03T17:15:57.000Z | 2022-03-31T03:13:47.000Z | tests/modeling/test_optimizer.py | sstsai-adl/d2go | 6cff773797b14698043589afe57ea67cd76286f9 | [
"Apache-2.0"
] | 90 | 2021-03-03T16:08:36.000Z | 2022-03-30T23:42:19.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import random
import unittest
import d2go.runner.default_runner as default_runner
import torch
from d2go.optimizer import (
build_optimizer_mapper,
)
from d2go.utils.testing import helper
class TestArch(torch.nn.Modul... | 33.139535 | 84 | 0.586199 |
import random
import unittest
import d2go.runner.default_runner as default_runner
import torch
from d2go.optimizer import (
build_optimizer_mapper,
)
from d2go.utils.testing import helper
class TestArch(torch.nn.Module):
def __init__(self):
super().__init__()
self.conv = torch.nn.Conv2d(3, ... | true | true |
f751e32877d0f32614921bd827efa45ac594f0f9 | 1,514 | py | Python | setup.py | tomkcook/erlang_py | ecce9fffbd050b47aa0db65293a7671c1ef49370 | [
"MIT"
] | 30 | 2016-02-07T02:27:50.000Z | 2022-01-01T22:59:39.000Z | setup.py | tomkcook/erlang_py | ecce9fffbd050b47aa0db65293a7671c1ef49370 | [
"MIT"
] | 7 | 2016-07-26T17:50:55.000Z | 2022-02-20T03:39:21.000Z | setup.py | tomkcook/erlang_py | ecce9fffbd050b47aa0db65293a7671c1ef49370 | [
"MIT"
] | 10 | 2016-07-26T08:09:51.000Z | 2022-02-10T16:37:41.000Z | #-*-Mode:python;coding:utf-8;tab-width:4;c-basic-offset:4;indent-tabs-mode:()-*-
# ex: set ft=python fenc=utf-8 sts=4 ts=4 sw=4 et:
try:
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
class PyTest(Command):
user_options = []
def initialize_options(s... | 32.212766 | 80 | 0.647292 |
try:
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import tests.erlang_tests
import ... | true | true |
f751e387b54f8926ee5c189503302bf77f699d40 | 1,223 | py | Python | app/firmware_analysis/views.py | dnr6419/iot_project | 7385eb3262a97b33faf5523fbafc0c27bb641be6 | [
"MIT"
] | null | null | null | app/firmware_analysis/views.py | dnr6419/iot_project | 7385eb3262a97b33faf5523fbafc0c27bb641be6 | [
"MIT"
] | null | null | null | app/firmware_analysis/views.py | dnr6419/iot_project | 7385eb3262a97b33faf5523fbafc0c27bb641be6 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.views.generic import ListView, TemplateView, View
from django.views.generic.edit import FormView
from django.core.files.storage import FileSystemStorage
from .forms import UploadFirmwareForm
from .utils import *
# / , main ... | 33.054054 | 64 | 0.717907 | from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.views.generic import ListView, TemplateView, View
from django.views.generic.edit import FormView
from django.core.files.storage import FileSystemStorage
from .forms import UploadFirmwareForm
from .utils import *
class MainT... | true | true |
f751e6818a0d116a67bb8066a9e265820d31b99a | 226 | py | Python | lang/Python/integer-comparison-1.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/integer-comparison-1.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/integer-comparison-1.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
a = eval(input('Enter value of a: '))
b = eval(input('Enter value of b: '))
if a < b:
print('a is less than b')
elif a > b:
print('a is greater than b')
elif a == b:
print('a is equal to b')
| 20.545455 | 37 | 0.575221 | a = eval(input('Enter value of a: '))
b = eval(input('Enter value of b: '))
if a < b:
print('a is less than b')
elif a > b:
print('a is greater than b')
elif a == b:
print('a is equal to b')
| true | true |
f751e6bbd8e3099b2c4ff11957323f232285b06b | 77,931 | py | Python | lib/endpoints-1.0/endpoints/api_config.py | airamrguez/appengine-1.8.0-golang-1.4.3-os-x-64bit | c2034c8ed4d218e1f85831df9bc986285ebf8661 | [
"Apache-2.0"
] | null | null | null | lib/endpoints-1.0/endpoints/api_config.py | airamrguez/appengine-1.8.0-golang-1.4.3-os-x-64bit | c2034c8ed4d218e1f85831df9bc986285ebf8661 | [
"Apache-2.0"
] | null | null | null | lib/endpoints-1.0/endpoints/api_config.py | airamrguez/appengine-1.8.0-golang-1.4.3-os-x-64bit | c2034c8ed4d218e1f85831df9bc986285ebf8661 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 35.536252 | 80 | 0.695731 |
try:
import json
except ImportError:
import simplejson as json
import logging
import re
from endpoints import message_parser
from endpoints import users_id_token
from protorpc import message_types
from protorpc import messages
from protorpc import remote
from protorpc import util
try:
from google.appengin... | true | true |
f751e7669d04a5b020b2241ac1ba9c9a020113f8 | 11,511 | py | Python | core.py | schreddies/DumpsterDiver | 80424bbe47ecb904e0fbd26acc013234e6eb7f97 | [
"MIT"
] | null | null | null | core.py | schreddies/DumpsterDiver | 80424bbe47ecb904e0fbd26acc013234e6eb7f97 | [
"MIT"
] | null | null | null | core.py | schreddies/DumpsterDiver | 80424bbe47ecb904e0fbd26acc013234e6eb7f97 | [
"MIT"
] | null | null | null | #!/bin/env python
import advancedSearch
import fnmatch
import json
import logging
import math
import mmap
import multiprocessing
import os
import passwordmeter
import re
import tarfile
import time
import yaml
import zipfile
import zlib
from termcolor import colored
CONFIG = yaml.safe_load(open('config.yaml'))
BASE64_... | 30.292105 | 112 | 0.567197 |
import advancedSearch
import fnmatch
import json
import logging
import math
import mmap
import multiprocessing
import os
import passwordmeter
import re
import tarfile
import time
import yaml
import zipfile
import zlib
from termcolor import colored
CONFIG = yaml.safe_load(open('config.yaml'))
BASE64_CHARS = CONFIG['ba... | true | true |
f751e820a3f6a0fb6c34b9a4f5f4ca9f80fb1508 | 1,888 | py | Python | aiida/backends/tests/cmdline/commands/test_status.py | lekah/aiida_core | 54b22a221657b47044483dc9d4f51788ce8ab6b2 | [
"BSD-2-Clause"
] | 1 | 2019-07-31T04:08:13.000Z | 2019-07-31T04:08:13.000Z | aiida/backends/tests/cmdline/commands/test_status.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | null | null | null | aiida/backends/tests/cmdline/commands/test_status.py | PercivalN/aiida-core | b215ed5a7ce9342bb7f671b67e95c1f474cc5940 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 44.952381 | 102 | 0.608051 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from click.testing import CliRunner
from aiida.backends.testbase import AiidaTestCase
from aiida.cmdline.commands import cmd_status
from aiida.backends.tests.utils.configuration import with_temporary_config_ins... | true | true |
f751e9e08d91c623738ab4692cac812e079f14c6 | 1,743 | py | Python | salt/pillar/cobbler.py | bruce-one/salt | 0715f6c29a8e19c3cf7a67ad41aff84801c9f5ae | [
"Apache-2.0"
] | 1 | 2016-04-20T08:18:07.000Z | 2016-04-20T08:18:07.000Z | salt/pillar/cobbler.py | quantonganh/salt | 8f1df678573153970c08b33978fe185d9ed1b71c | [
"Apache-2.0"
] | null | null | null | salt/pillar/cobbler.py | quantonganh/salt | 8f1df678573153970c08b33978fe185d9ed1b71c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
A module to pull data from Cobbler via its API into the Pillar dictionary
Configuring the Cobbler ext_pillar
==================================
The same cobbler.* parameters are used for both the Cobbler tops and Cobbler pillar
modules.
.. code-block:: yaml
ext_pillar:
- cobbler:
... | 25.26087 | 87 | 0.635112 |
import logging
import xmlrpclib
__opts__ = {'cobbler.url': 'http://localhost/cobbler_api',
'cobbler.user': None,
'cobbler.password': None
}
log = logging.getLogger(__name__)
def ext_pillar(minion_id, pillar, key=None, only=()):
url = __opts__['cobbler.url']
user = __opt... | true | true |
f751ea5bf2bf774b28cadf668164dbc19f084b66 | 1,109 | py | Python | run_FFT_analyzer.py | cerkut/Realtime_PyAudio_FFT | f0da7e65cd64b2667b4135bffd4886b2902c34b8 | [
"MIT"
] | null | null | null | run_FFT_analyzer.py | cerkut/Realtime_PyAudio_FFT | f0da7e65cd64b2667b4135bffd4886b2902c34b8 | [
"MIT"
] | null | null | null | run_FFT_analyzer.py | cerkut/Realtime_PyAudio_FFT | f0da7e65cd64b2667b4135bffd4886b2902c34b8 | [
"MIT"
] | null | null | null | import time
from src.stream_analyzer import Stream_Analyzer
ear = Stream_Analyzer(
device = None, # Manually play with this (int) if you don't see anything
rate = None, # Audio samplerate, None uses the default source settings
FFT_window_siz... | 52.809524 | 102 | 0.596934 | import time
from src.stream_analyzer import Stream_Analyzer
ear = Stream_Analyzer(
device = None, rate = None, # Audio samplerate, None uses the default source settings
FFT_window_size_ms = 40, # Window size used for the FFT transform
... | true | true |
f751eb314feb83c9cc28878f0af8192a32d0e2ac | 828 | py | Python | docs/Advanced_development/zh/QuecPythonSub/code/i2c_base.py | quecpython/Community-document | 64e3c0c76df8c8a44dcfdbc2a813fbd5578c8740 | [
"MIT"
] | 3 | 2021-04-03T05:08:32.000Z | 2021-07-20T08:54:38.000Z | docs/Advanced_development/zh/QuecPythonSub/code/i2c_base.py | quecpython/Community-document | 64e3c0c76df8c8a44dcfdbc2a813fbd5578c8740 | [
"MIT"
] | 1 | 2021-03-09T06:36:49.000Z | 2021-03-09T06:36:49.000Z | docs/Advanced_development/zh/QuecPythonSub/code/i2c_base.py | quecpython/Community-document | 64e3c0c76df8c8a44dcfdbc2a813fbd5578c8740 | [
"MIT"
] | 10 | 2021-03-09T03:02:24.000Z | 2021-07-16T02:53:05.000Z | from machine import I2C
def test_i2c():
i2c_dev = I2C(I2C.I2C1, I2C.STANDARD_MODE)
addres = 0x19
LIS2DH12_WHO_AM_I = 0x0F # 板载三轴加速度传感器 身份寄存器
r_data = bytearray([0x00]) # 存储数据
i2c_dev.read(addres, bytearray(LIS2DH12_WHO_AM_I), 1, r_data, 1, 1)
print("read data lis2dh12 who_am_i reg 0x{0:02x}"... | 31.846154 | 78 | 0.660628 | from machine import I2C
def test_i2c():
i2c_dev = I2C(I2C.I2C1, I2C.STANDARD_MODE)
addres = 0x19
LIS2DH12_WHO_AM_I = 0x0F r_data = bytearray([0x00]) i2c_dev.read(addres, bytearray(LIS2DH12_WHO_AM_I), 1, r_data, 1, 1)
print("read data lis2dh12 who_am_i reg 0x{0:02x}".format(list(r_data)[0]))
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.