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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f707c66759e748052baf1d1b8d95b91737e37c5f | 1,421 | py | Python | var/spack/repos/builtin/packages/py-pycairo/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/py-pycairo/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/py-pycairo/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
from spack import *
class PyPycairo(PythonPackage):
"""Pycairo is a set of Python bindings for the cairo ... | 40.6 | 96 | 0.68121 |
import os
from spack import *
class PyPycairo(PythonPackage):
homepage = "https://www.cairographics.org/pycairo/"
pypi = "pycairo/pycairo-1.17.1.tar.gz"
version('1.20.0', sha256='5695a10cb7f9ae0d01f665b56602a845b0a8cb17e2123bfece10c2e58552468c')
version('1.18.1', sha256='70172e58b6bad7572a3518c267... | true | true |
f707c6739dae4cd8d9569f54bb93dba89cc51996 | 3,303 | py | Python | qiskit/circuit/library/standard_gates/s.py | yeralin/qiskit-terra | 251930a7b5d83af121ea0f3aafb33a54a1860e14 | [
"Apache-2.0"
] | 1 | 2020-10-25T17:56:57.000Z | 2020-10-25T17:56:57.000Z | qiskit/circuit/library/standard_gates/s.py | yeralin/qiskit-terra | 251930a7b5d83af121ea0f3aafb33a54a1860e14 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/standard_gates/s.py | yeralin/qiskit-terra | 251930a7b5d83af121ea0f3aafb33a54a1860e14 | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 25.21374 | 81 | 0.544051 |
import numpy
from qiskit.qasm import pi
from qiskit.circuit.gate import Gate
from qiskit.circuit.quantumregister import QuantumRegister
class SGate(Gate):
def __init__(self, label=None):
super().__init__('s', 1, [], label=label)
def _define(self):
from qiskit.circuit.quantumcircuit... | true | true |
f707c6d480737417d70c708d14c32c7ba550b80b | 6,151 | py | Python | mongodb/factory/timer.py | RaenonX/Jelly-Bot-API | c7da1e91783dce3a2b71b955b3a22b68db9056cf | [
"MIT"
] | 5 | 2020-08-26T20:12:00.000Z | 2020-12-11T16:39:22.000Z | mongodb/factory/timer.py | RaenonX/Jelly-Bot | c7da1e91783dce3a2b71b955b3a22b68db9056cf | [
"MIT"
] | 234 | 2019-12-14T03:45:19.000Z | 2020-08-26T18:55:19.000Z | mongodb/factory/timer.py | RaenonX/Jelly-Bot-API | c7da1e91783dce3a2b71b955b3a22b68db9056cf | [
"MIT"
] | 2 | 2019-10-23T15:21:15.000Z | 2020-05-22T09:35:55.000Z | """Data manager for the timers."""
from datetime import datetime, timedelta
from typing import Optional, List
import pymongo
from bson import ObjectId
from models import TimerModel, TimerListResult, OID_KEY
from mongodb.factory.results import WriteOutcome
from extutils.checker import arg_type_ensure
from extutils.loc... | 36.613095 | 114 | 0.664282 | from datetime import datetime, timedelta
from typing import Optional, List
import pymongo
from bson import ObjectId
from models import TimerModel, TimerListResult, OID_KEY
from mongodb.factory.results import WriteOutcome
from extutils.checker import arg_type_ensure
from extutils.locales import UTC
from extutils.dt im... | true | true |
f707c9b9127d02117714037a1a1e058f1ab6331e | 7,900 | py | Python | daily_fantasy_sports_scoring_calculators/draft_kings/nfl/scoring/calculators/statistical_value_to_points/offensive.py | jaebradley/daily_fantasy_sports_scoring_calculators | 99b7e0443637cb4405ccdad7fa4f136af914307b | [
"MIT"
] | null | null | null | daily_fantasy_sports_scoring_calculators/draft_kings/nfl/scoring/calculators/statistical_value_to_points/offensive.py | jaebradley/daily_fantasy_sports_scoring_calculators | 99b7e0443637cb4405ccdad7fa4f136af914307b | [
"MIT"
] | 3 | 2021-09-05T01:40:16.000Z | 2021-09-20T06:53:54.000Z | daily_fantasy_sports_scoring_calculators/draft_kings/nfl/scoring/calculators/statistical_value_to_points/offensive.py | jaebradley/daily_fantasy_sports_scoring_calculators | 99b7e0443637cb4405ccdad7fa4f136af914307b | [
"MIT"
] | null | null | null | from daily_fantasy_sports_scoring_calculators.core.calculators.scoring import StatisticalCategoryPointsCalculator, \
StatisticalValueCalculator
from daily_fantasy_sports_scoring_calculators.draft_kings.nfl.scoring.calculators.value_to_points.offensive import \
PassingTouchdownsCalculator as PassingTouchdownsPoi... | 41.578947 | 116 | 0.797089 | from daily_fantasy_sports_scoring_calculators.core.calculators.scoring import StatisticalCategoryPointsCalculator, \
StatisticalValueCalculator
from daily_fantasy_sports_scoring_calculators.draft_kings.nfl.scoring.calculators.value_to_points.offensive import \
PassingTouchdownsCalculator as PassingTouchdownsPoi... | true | true |
f707c9bae6d69a9013fae62fea2c4855ede04e46 | 13,339 | py | Python | utils/orderedcollections.py | orionzhou/biolib | 940fb66f1b2608d34a2d00ebdf41dc84c6381f42 | [
"BSD-2-Clause"
] | 3 | 2019-02-22T20:35:23.000Z | 2021-11-25T10:01:50.000Z | utils/orderedcollections.py | orionzhou/biolib | 940fb66f1b2608d34a2d00ebdf41dc84c6381f42 | [
"BSD-2-Clause"
] | null | null | null | utils/orderedcollections.py | orionzhou/biolib | 940fb66f1b2608d34a2d00ebdf41dc84c6381f42 | [
"BSD-2-Clause"
] | 1 | 2021-02-19T03:10:14.000Z | 2021-02-19T03:10:14.000Z | # Copyright (c) 2009 Raymond Hettinger
#
# 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,
# publish,... | 33.3475 | 87 | 0.605518 |
from urllib.parse import urlparse
from collections import Callable, defaultdict
try:
from UserDict import UserDict
from UserDict import DictMixin
except ImportError:
from collections import UserDict
from collections import MutableMapping as DictMixin
class OrderedDict(dict, DictMixin):
def __ini... | true | true |
f707ca2e53757b03d3bb7f1b28158ce7a33af228 | 1,519 | py | Python | manager_app/urls.py | syz247179876/e_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 7 | 2021-04-10T13:20:56.000Z | 2022-03-29T15:00:29.000Z | manager_app/urls.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 9 | 2021-05-11T03:53:31.000Z | 2022-03-12T00:58:03.000Z | manager_app/urls.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 2 | 2020-11-24T08:59:22.000Z | 2020-11-24T14:10:59.000Z | # -*- coding: utf-8 -*-
# @Time : 2021/2/10 δΈε12:59
# @Author : εΈδΊδΈ
# @File : urls.py
# @Software: Pycharm
from django.conf import settings
from django.urls import path, include
from manager_app.apis.auth_api import ManagerLoginApiView, ManagerRegisterApiView
from manager_app.apis.manage_carousel_api import ManageCar... | 46.030303 | 110 | 0.789993 | from django.conf import settings
from django.urls import path, include
from manager_app.apis.auth_api import ManagerLoginApiView, ManagerRegisterApiView
from manager_app.apis.manage_carousel_api import ManageCarouselApiView
from manager_app.apis.manage_commodity_api import ManagerCommodityCategoryApiView, ManageCommod... | true | true |
f707caeebe22a441a1841182e56fb3dd303cb612 | 26,230 | py | Python | cpython/Lib/tempfile.py | ms-iot/python | a8f8fba1214289572713520f83409762a4446fea | [
"BSD-3-Clause"
] | 70 | 2015-06-20T17:59:24.000Z | 2021-05-03T02:01:49.000Z | cpython/Lib/tempfile.py | ms-iot/python | a8f8fba1214289572713520f83409762a4446fea | [
"BSD-3-Clause"
] | 16 | 2015-06-11T14:57:43.000Z | 2016-12-03T00:22:13.000Z | cpython/Lib/tempfile.py | ms-iot/python | a8f8fba1214289572713520f83409762a4446fea | [
"BSD-3-Clause"
] | 36 | 2015-05-15T20:30:44.000Z | 2020-11-14T19:31:40.000Z | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. All of the interfaces
provided by this module can be used without fear of race conditions
except for 'mktemp'. 'mktemp' is subject to race conditions and
should not be used; it is provided f... | 32.665006 | 90 | 0.613534 |
__all__ = [
"NamedTemporaryFile", "TemporaryFile", "SpooledTemporaryFile", "TemporaryDirectory",
"mkstemp", "mkdtemp", "mktemp", "TMP_MAX", "gettempprefix", "tempdir", "gettempdir",
"gettempprefixb", "gettempdirb",
]
import func... | true | true |
f707cbac1aca777e5d3d509ba0a7688f9b5cab02 | 4,392 | py | Python | util/gen_parser.py | wenkeyang/foursquared.eclair | c8a916778e02ac2bac36022e1db65d08f94dff9b | [
"Apache-2.0"
] | 3 | 2016-10-19T17:46:16.000Z | 2016-10-19T17:53:28.000Z | util/gen_parser.py | wenkeyang/foursquared.eclair | c8a916778e02ac2bac36022e1db65d08f94dff9b | [
"Apache-2.0"
] | 73 | 2022-03-27T21:43:49.000Z | 2022-03-27T21:44:32.000Z | util/gen_parser.py | wenkeyang/foursquared.eclair | c8a916778e02ac2bac36022e1db65d08f94dff9b | [
"Apache-2.0"
] | 1 | 2020-07-14T17:32:21.000Z | 2020-07-14T17:32:21.000Z | #!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joel... | 29.28 | 116 | 0.667122 |
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joelapenna.foursquare.... | false | true |
f707cbfb17d3f0aaabf8186795d08e5f8861d69f | 4,763 | py | Python | q2_feature_table/_filter.py | andrewsanchez/q2-feature-table | 9ed6160adad45445ec054e5ce034a3b3ba25a9b4 | [
"BSD-3-Clause"
] | null | null | null | q2_feature_table/_filter.py | andrewsanchez/q2-feature-table | 9ed6160adad45445ec054e5ce034a3b3ba25a9b4 | [
"BSD-3-Clause"
] | null | null | null | q2_feature_table/_filter.py | andrewsanchez/q2-feature-table | 9ed6160adad45445ec054e5ce034a3b3ba25a9b4 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 41.780702 | 78 | 0.622297 |
import biom
import qiime2
import numpy as np
import pandas as pd
def _get_biom_filter_function(ids_to_keep, min_frequency, max_frequency,
min_nonzero, max_nonzero):
ids_to_keep = set(ids_to_keep)
if max_frequency is None:
max_frequency = np.inf
if max_nonzero is None... | true | true |
f707cc59db04834474887b8af1640934d57e50d9 | 19,428 | py | Python | scripts/lib/zulip_tools.py | shubhamgupta2956/zulip | 77091c7b17a0a37392eaa8765d46e3c673da081a | [
"Apache-2.0"
] | 2 | 2020-09-12T13:36:15.000Z | 2021-06-28T18:10:41.000Z | scripts/lib/zulip_tools.py | shubhamgupta2956/zulip | 77091c7b17a0a37392eaa8765d46e3c673da081a | [
"Apache-2.0"
] | null | null | null | scripts/lib/zulip_tools.py | shubhamgupta2956/zulip | 77091c7b17a0a37392eaa8765d46e3c673da081a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import configparser
import datetime
import functools
import hashlib
import json
import logging
import os
import pwd
import random
import re
import shlex
import shutil
import subprocess
import sys
import time
import uuid
from typing import Any, Dict, List, Sequence, Set
from urllib... | 36.044527 | 103 | 0.648446 | import argparse
import configparser
import datetime
import functools
import hashlib
import json
import logging
import os
import pwd
import random
import re
import shlex
import shutil
import subprocess
import sys
import time
import uuid
from typing import Any, Dict, List, Sequence, Set
from urllib.parse import SplitResu... | true | true |
f707cd250d370f16f94ca0d06c3d986e3b974eec | 12,396 | py | Python | sdk/sql/azure-mgmt-sql/tests/test_cli_mgmt_sql_managed_instance.py | zeinab-mk/azure-sdk-for-python | 847e95a542506239db4aa6c12fa5ae35aa7d5e56 | [
"MIT"
] | 1 | 2022-03-08T04:21:07.000Z | 2022-03-08T04:21:07.000Z | sdk/sql/azure-mgmt-sql/tests/test_cli_mgmt_sql_managed_instance.py | zeinab-mk/azure-sdk-for-python | 847e95a542506239db4aa6c12fa5ae35aa7d5e56 | [
"MIT"
] | null | null | null | sdk/sql/azure-mgmt-sql/tests/test_cli_mgmt_sql_managed_instance.py | zeinab-mk/azure-sdk-for-python | 847e95a542506239db4aa6c12fa5ae35aa7d5e56 | [
"MIT"
] | null | null | null | # 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.
#----------------------------------------------------------------------... | 44.750903 | 200 | 0.53364 |
import unittest
import azure.mgmt.sql
from azure.core.exceptions import HttpResponseError
from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, ResourceGroupPreparer, recorded_by_proxy
AZURE_LOCATION = 'eastus'
class MgmtSqlTest(AzureMgmtRecordedTestCase):
def setup_metho... | true | true |
f707ce44165fb1f567e85f5b11485980daeb77e2 | 4,142 | py | Python | packages/dcos-integration-test/extra/test_endpoints.py | aaronjwood/dcos | b5f75d38e85e26ead42a1c41ec70c7c09591c6c0 | [
"Apache-2.0"
] | null | null | null | packages/dcos-integration-test/extra/test_endpoints.py | aaronjwood/dcos | b5f75d38e85e26ead42a1c41ec70c7c09591c6c0 | [
"Apache-2.0"
] | null | null | null | packages/dcos-integration-test/extra/test_endpoints.py | aaronjwood/dcos | b5f75d38e85e26ead42a1c41ec70c7c09591c6c0 | [
"Apache-2.0"
] | null | null | null | import urllib.parse
import bs4
from retrying import retry
def test_if_dcos_ui_is_up(cluster):
r = cluster.get('/')
assert r.status_code == 200
assert len(r.text) > 100
assert 'DC/OS' in r.text
# Not sure if it's really needed, seems a bit of an overkill:
soup = bs4.BeautifulSoup(r.text, "ht... | 28.763889 | 93 | 0.666586 | import urllib.parse
import bs4
from retrying import retry
def test_if_dcos_ui_is_up(cluster):
r = cluster.get('/')
assert r.status_code == 200
assert len(r.text) > 100
assert 'DC/OS' in r.text
soup = bs4.BeautifulSoup(r.text, "html.parser")
for link in soup.find_all(['link', 'a'], href=... | true | true |
f707d017ac3d245d2a68479e9e3c93fb3bf18ce3 | 3,399 | py | Python | mysite/settings.py | sssunda/django-board-REST | 3151491764c8b79227eb537b1ecd4ee321d9d80b | [
"MIT"
] | 1 | 2019-06-06T07:56:36.000Z | 2019-06-06T07:56:36.000Z | mysite/settings.py | sssunda/django-board-REST | 3151491764c8b79227eb537b1ecd4ee321d9d80b | [
"MIT"
] | null | null | null | mysite/settings.py | sssunda/django-board-REST | 3151491764c8b79227eb537b1ecd4ee321d9d80b | [
"MIT"
] | null | null | null | """
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# ... | 25.556391 | 91 | 0.68932 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '@2%a3gla^-3_x-7fxprr=@o=mafg(ac2%7drm9hbjj02xp&^@9'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
f707d07c1a26a18889462b824307dc5c95ab19c8 | 1,509 | py | Python | contrib/gnu/gdb/dist/gdb/testsuite/gdb.perf/skip-prologue.py | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | 3 | 2021-05-04T17:09:06.000Z | 2021-10-04T07:19:26.000Z | contrib/gnu/gdb/dist/gdb/testsuite/gdb.perf/skip-prologue.py | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | null | null | null | contrib/gnu/gdb/dist/gdb/testsuite/gdb.perf/skip-prologue.py | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (C) 2013-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This progr... | 35.093023 | 71 | 0.673294 |
from perftest import perftest
class SkipPrologue(perftest.TestCaseWithBasicMeasurements):
def __init__(self, count):
super(SkipPrologue, self).__init__("skip-prologue")
self.count = count
def _test(self):
for _ in range(1, self.count):
bp1 = gdb.Breakpoint("f... | true | true |
f707d0bd49a7e0eeabc8b6ddd6261aa57c75d0a8 | 4,679 | py | Python | tests/helpers.py | sthagen/pwwang-pipen | 2d32105511222cff2287e985708e80eba56276c7 | [
"Apache-2.0"
] | 41 | 2017-08-30T10:26:37.000Z | 2020-10-14T01:37:52.000Z | tests/helpers.py | sthagen/pwwang-pipen | 2d32105511222cff2287e985708e80eba56276c7 | [
"Apache-2.0"
] | 39 | 2017-09-22T18:40:17.000Z | 2020-11-04T06:49:42.000Z | tests/helpers.py | sthagen/pwwang-pipen | 2d32105511222cff2287e985708e80eba56276c7 | [
"Apache-2.0"
] | 7 | 2018-07-02T05:57:16.000Z | 2019-12-23T07:43:47.000Z | import sys
import signal
from tempfile import gettempdir
from pathlib import Path
from shutil import rmtree
from multiprocessing import Process
import pytest
from pipen import Proc, Pipen, plugin
class SimpleProc(Proc):
"""A very simple process for testing"""
input = ["input"]
class NormalProc(Proc):
... | 20.70354 | 89 | 0.617226 | import sys
import signal
from tempfile import gettempdir
from pathlib import Path
from shutil import rmtree
from multiprocessing import Process
import pytest
from pipen import Proc, Pipen, plugin
class SimpleProc(Proc):
input = ["input"]
class NormalProc(Proc):
input = "input:var"
output = ["output:{... | true | true |
f707d13018e5e0a1f28f8e6d9e855991edd6547f | 974 | py | Python | src/oneShot/testScripters/wordUse/wordUse.py | andypohl/kent | af7a004c8f3fa909cd8c2cfc2e5bea60e3421cd1 | [
"MIT"
] | 171 | 2015-04-22T15:16:02.000Z | 2022-03-18T20:21:53.000Z | src/oneShot/testScripters/wordUse/wordUse.py | andypohl/kent | af7a004c8f3fa909cd8c2cfc2e5bea60e3421cd1 | [
"MIT"
] | 60 | 2016-10-03T15:15:06.000Z | 2022-03-30T15:21:52.000Z | src/oneShot/testScripters/wordUse/wordUse.py | andypohl/kent | af7a004c8f3fa909cd8c2cfc2e5bea60e3421cd1 | [
"MIT"
] | 80 | 2015-04-16T10:39:48.000Z | 2022-03-29T16:36:30.000Z | # wordUse - count words in file and print top ten
import sys
def usage():
"""explain usage and exit"""
sys.exit("""wordUse - count words in file and print top ten
usage:
wordUse files""")
class wordCount:
"""Count number of uses of word."""
def __init__(self, word):
self.word = word
self... | 21.173913 | 64 | 0.571869 | import sys
def usage():
"""explain usage and exit"""
sys.exit("""wordUse - count words in file and print top ten
usage:
wordUse files""")
class wordCount:
"""Count number of uses of word."""
def __init__(self, word):
self.word = word
self.count = 0
def __cmp__(self,other):
re... | false | true |
f707d1d9378240dadfe0c5fce252cd9de45207d3 | 3,701 | py | Python | demo/app.py | Mariatta/arq | 7d44d1db21cc4c8eb0c6e24f510f6ba054a72f25 | [
"MIT"
] | 1 | 2021-01-03T00:57:38.000Z | 2021-01-03T00:57:38.000Z | demo/app.py | Mariatta/arq | 7d44d1db21cc4c8eb0c6e24f510f6ba054a72f25 | [
"MIT"
] | null | null | null | demo/app.py | Mariatta/arq | 7d44d1db21cc4c8eb0c6e24f510f6ba054a72f25 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.6
import os
import asyncio
from time import time
import chevron
import uvloop
from aiohttp import web, ClientError, ClientSession
from aiohttp_session import SimpleCookieStorage, get_session
from aiohttp_session import setup as session_setup
from arq import Actor, BaseWorker, RedisSettings, conc... | 27.827068 | 100 | 0.634153 | import os
import asyncio
from time import time
import chevron
import uvloop
from aiohttp import web, ClientError, ClientSession
from aiohttp_session import SimpleCookieStorage, get_session
from aiohttp_session import setup as session_setup
from arq import Actor, BaseWorker, RedisSettings, concurrent
R_OUTPUT = 'outpu... | true | true |
f707d253c63d9914028eb228f855eea4ce59bc50 | 248 | py | Python | simple_fem/__init__.py | IgorBaratta/simple_fem | 292294fdcef263b3ddebdc79dfaa05cb2cefe60f | [
"MIT"
] | null | null | null | simple_fem/__init__.py | IgorBaratta/simple_fem | 292294fdcef263b3ddebdc79dfaa05cb2cefe60f | [
"MIT"
] | null | null | null | simple_fem/__init__.py | IgorBaratta/simple_fem | 292294fdcef263b3ddebdc79dfaa05cb2cefe60f | [
"MIT"
] | null | null | null | from .fem import DofMap, Q1Element
from .function_space import FunctionSpace
from .mesh import Mesh, ReferenceQuadrilateral
from .plot import plot
from .quadrature import Quadrature
from .assemble import assemble_vector, assemble_matrix, apply_bc
| 31 | 64 | 0.842742 | from .fem import DofMap, Q1Element
from .function_space import FunctionSpace
from .mesh import Mesh, ReferenceQuadrilateral
from .plot import plot
from .quadrature import Quadrature
from .assemble import assemble_vector, assemble_matrix, apply_bc
| true | true |
f707d39dbc4cb9a4b69e990dc483c17469e34d51 | 536 | py | Python | vmm/__main__.py | kmohrf/vmm | 5e0dc8c9502d07681bfaca8634ed5b083deae77b | [
"BSD-3-Clause"
] | 4 | 2020-03-08T08:45:35.000Z | 2021-10-17T11:05:17.000Z | vmm/__main__.py | kmohrf/vmm | 5e0dc8c9502d07681bfaca8634ed5b083deae77b | [
"BSD-3-Clause"
] | null | null | null | vmm/__main__.py | kmohrf/vmm | 5e0dc8c9502d07681bfaca8634ed5b083deae77b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# Copyright 2007 - 2014, Pascal Volk
# See COPYING for distribution information.
"""This is the vmm main script."""
import sys
if __name__ == "__main__":
# replace the script's cwd (/usr/local/sbin) with our module dir
# (the location of the vmm directory) - if ... | 28.210526 | 68 | 0.666045 |
import sys
if __name__ == "__main__":
# (the location of the vmm directory) - if it is not in sys.path
# sys.path[0] = '/usr/local/lib/vmm'
# Otherwise just remove /usr/local/sbin from sys.path
sys.path.remove(sys.path[0])
from vmm.cli.main import run
sys.exit(run(sys.argv))
| true | true |
f707d51f70d5c76439265b879aeec29bd4a6d006 | 2,533 | py | Python | tests/api/routes/test_routes_init.py | VizierDB/web-api-async | e99f43df3df80ad5647f57d805c339257336ac73 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-10-21T03:01:39.000Z | 2020-06-05T01:43:00.000Z | tests/api/routes/test_routes_init.py | VizierDB/web-api-async | e99f43df3df80ad5647f57d805c339257336ac73 | [
"ECL-2.0",
"Apache-2.0"
] | 56 | 2019-07-12T21:16:03.000Z | 2020-11-06T23:29:22.000Z | tests/api/routes/test_routes_init.py | VizierDB/web-api-async | e99f43df3df80ad5647f57d805c339257336ac73 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-02-07T19:56:55.000Z | 2020-08-07T11:17:51.000Z | """Test initialization of the url factory classes"""
import unittest
from vizier.api.routes.base import UrlFactory
from vizier.api.routes.base import PROPERTIES_BASEURL, PROPERTIES_APIDOCURL
from vizier.api.routes.task import TaskUrlFactory
class TestUrlFactoryInit(unittest.TestCase):
def test_init_url_factory... | 37.80597 | 88 | 0.617055 |
import unittest
from vizier.api.routes.base import UrlFactory
from vizier.api.routes.base import PROPERTIES_BASEURL, PROPERTIES_APIDOCURL
from vizier.api.routes.task import TaskUrlFactory
class TestUrlFactoryInit(unittest.TestCase):
def test_init_url_factory(self):
urls = UrlFactory(base_url='http://ab... | true | true |
f707d527fa31fabb43356f22df07e5fa96b0e200 | 3,790 | py | Python | lib/protorpc-1.0/protorpc/message_types.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 76 | 2015-01-04T13:45:16.000Z | 2022-02-12T11:06:49.000Z | lib/protorpc-1.0/protorpc/message_types.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 27 | 2015-02-12T20:04:37.000Z | 2020-04-28T07:51:39.000Z | lib/protorpc-1.0/protorpc/message_types.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 42 | 2015-01-24T09:49:07.000Z | 2020-10-13T16:59:31.000Z | #!/usr/bin/env python
#
# Copyright 2010 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... | 31.583333 | 78 | 0.687335 |
__author__ = 'rafek@google.com (Rafe Kaplan)'
import datetime
from . import messages
from . import util
__all__ = [
'DateTimeField',
'DateTimeMessage',
'VoidMessage',
]
class VoidMessage(messages.Message):
class DateTimeMessage(messages.Message):
milliseconds = messages.IntegerField(1, required=Tr... | true | true |
f707d5397bf7e46d6b3b59811c31a1684ec0baed | 11,809 | py | Python | tests/test-cluster.py | tripolkaandrey/microk8s | 6270ca450fab6bf98b25f0df473461210694775d | [
"Apache-2.0"
] | 1 | 2021-02-08T09:14:44.000Z | 2021-02-08T09:14:44.000Z | tests/test-cluster.py | tripolkaandrey/microk8s | 6270ca450fab6bf98b25f0df473461210694775d | [
"Apache-2.0"
] | 15 | 2021-05-02T05:10:59.000Z | 2022-03-09T22:27:19.000Z | tests/test-cluster.py | thanhtung22-cloud/microk8s | d1d02633ca245af9724094447be2e3c144526b35 | [
"Apache-2.0"
] | null | null | null | import string
import random
import time
import pytest
import os
import subprocess
from os import path
# Provide a list of VMs you want to reuse. VMs should have already microk8s installed.
# the test will attempt a refresh to the channel requested for testing
# reuse_vms = ['vm-ldzcjb', 'vm-nfpgea', 'vm-pkgbtw']
reus... | 39.494983 | 98 | 0.519519 | import string
import random
import time
import pytest
import os
import subprocess
from os import path
reuse_vms = None
channel_to_test = os.environ.get("CHANNEL_TO_TEST", "edge/ha-preview")
backend = os.environ.get("BACKEND", None)
class VM:
def __init__(self, attach_vm=None):
rnd_letters = "".join(ran... | true | true |
f707d5fe8383434cfbe843f45b38fefdbbbbb7fb | 526 | py | Python | python_toolbox/binary_search/__init__.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 119 | 2015-02-05T17:59:47.000Z | 2022-02-21T22:43:40.000Z | python_toolbox/binary_search/__init__.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 4 | 2019-04-24T14:01:14.000Z | 2020-05-21T12:03:29.000Z | python_toolbox/binary_search/__init__.py | hboshnak/python_toolbox | cb9ef64b48f1d03275484d707dc5079b6701ad0c | [
"MIT"
] | 14 | 2015-03-30T06:30:42.000Z | 2021-12-24T23:45:11.000Z | # Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
'''A package for doing a binary search in a sequence.'''
from .roundings import (Rounding, LOW, LOW_IF_BOTH, LOW_OTHERWISE_HIGH, HIGH,
HIGH_IF_BOTH, HIGH_OTHERWISE_LOW, EXACT, CLOSEST,
... | 47.818182 | 77 | 0.711027 |
from .roundings import (Rounding, LOW, LOW_IF_BOTH, LOW_OTHERWISE_HIGH, HIGH,
HIGH_IF_BOTH, HIGH_OTHERWISE_LOW, EXACT, CLOSEST,
CLOSEST_IF_BOTH, BOTH)
from .functions import (binary_search, binary_search_by_index,
make_both_data_into_preferred_ro... | true | true |
f707d613ff7ebc27f3707beca316b702b82b34b7 | 2,503 | py | Python | setup.py | haroldham/hive-sbi | 2d99703ee9e4675dbae986c1e656bf714b72d0b5 | [
"MIT"
] | 4 | 2018-09-23T07:56:18.000Z | 2020-04-08T03:29:19.000Z | setup.py | haroldham/hive-sbi | 2d99703ee9e4675dbae986c1e656bf714b72d0b5 | [
"MIT"
] | 10 | 2018-07-31T06:30:28.000Z | 2020-03-23T16:31:03.000Z | setup.py | haroldham/hive-sbi | 2d99703ee9e4675dbae986c1e656bf714b72d0b5 | [
"MIT"
] | 9 | 2018-07-16T20:19:29.000Z | 2021-04-14T23:58:42.000Z | # -*- coding: utf-8 -*-
"""Packaging logic for beem."""
import codecs
import io
import os
import sys
from setuptools import setup
# Work around mbcs bug in distutils.
# http://bugs.python.org/issue10945
try:
codecs.lookup('mbcs')
except LookupError:
ascii = codecs.lookup('ascii')
codecs.register(lambda n... | 28.443182 | 86 | 0.596884 | import codecs
import io
import os
import sys
from setuptools import setup
try:
codecs.lookup('mbcs')
except LookupError:
ascii = codecs.lookup('ascii')
codecs.register(lambda name, enc=ascii: {True: enc}.get(name == 'mbcs'))
VERSION = '0.1.2'
tests_require = ['mock >= 2.0.0', 'pytest', 'pytest-mock', '... | true | true |
f707d72b8bccb6192906d8fac11ec9b1ba13c7c0 | 369 | py | Python | tools/c7n_mailer/c7n_mailer/utils_email.py | sstarcher/cloud-custodian | fc5b51019e9c15d0582089133d080bceee489a94 | [
"Apache-2.0"
] | null | null | null | tools/c7n_mailer/c7n_mailer/utils_email.py | sstarcher/cloud-custodian | fc5b51019e9c15d0582089133d080bceee489a94 | [
"Apache-2.0"
] | null | null | null | tools/c7n_mailer/c7n_mailer/utils_email.py | sstarcher/cloud-custodian | fc5b51019e9c15d0582089133d080bceee489a94 | [
"Apache-2.0"
] | null | null | null | import logging
from email.utils import parseaddr
logger = logging.getLogger('c7n_mailer.utils.email')
def is_email(target):
if target.startswith('slack://'):
logger.debug("Slack payload, not an email.")
return False
if parseaddr(target)[1] and '@' in target and '.' in target:
... | 24.6 | 65 | 0.631436 | import logging
from email.utils import parseaddr
logger = logging.getLogger('c7n_mailer.utils.email')
def is_email(target):
if target.startswith('slack://'):
logger.debug("Slack payload, not an email.")
return False
if parseaddr(target)[1] and '@' in target and '.' in target:
... | true | true |
f707d8d338f577afbfffde813e38b1c37c20c5c9 | 1,525 | py | Python | spin/models/smpl.py | krumo/SPIN | 0e2f17e70f06de46e062683ea6d5b233eeaa73c1 | [
"BSD-3-Clause"
] | null | null | null | spin/models/smpl.py | krumo/SPIN | 0e2f17e70f06de46e062683ea6d5b233eeaa73c1 | [
"BSD-3-Clause"
] | null | null | null | spin/models/smpl.py | krumo/SPIN | 0e2f17e70f06de46e062683ea6d5b233eeaa73c1 | [
"BSD-3-Clause"
] | null | null | null | import torch
import numpy as np
import smplx
from smplx import SMPL as _SMPL
from smplx.body_models import ModelOutput
from smplx.lbs import vertices2joints
import spin.config as config
import spin.constants as constants
class SMPL(_SMPL):
""" Extension of the official SMPL implementation to support more joints "... | 42.361111 | 103 | 0.658361 | import torch
import numpy as np
import smplx
from smplx import SMPL as _SMPL
from smplx.body_models import ModelOutput
from smplx.lbs import vertices2joints
import spin.config as config
import spin.constants as constants
class SMPL(_SMPL):
def __init__(self, *args, **kwargs):
super(SMPL, self).__init__(*... | true | true |
f707d9f5ae195709bc3343f36776ae832f905010 | 522 | py | Python | Python_Implementation/Test_Codes/Test1.py | ishtiaqniloy/CSE_406_TCP_Reset_Attack_Video_Streaming | 849e3595a75cedaa8142a025eb22e1bb8871be36 | [
"MIT"
] | 2 | 2019-09-08T15:12:38.000Z | 2019-09-23T04:36:18.000Z | Python_Implementation/Test_Codes/Test1.py | ishtiaqniloy/CSE_406_TCP_Reset_Attack_Video_Streaming | 849e3595a75cedaa8142a025eb22e1bb8871be36 | [
"MIT"
] | null | null | null | Python_Implementation/Test_Codes/Test1.py | ishtiaqniloy/CSE_406_TCP_Reset_Attack_Video_Streaming | 849e3595a75cedaa8142a025eb22e1bb8871be36 | [
"MIT"
] | 1 | 2021-05-25T09:58:46.000Z | 2021-05-25T09:58:46.000Z | from scapy.all import *
from scapy.all import send
from scapy.layers.inet import *
srcIP = "192.168.0.103"
destIP = "192.168.0.108"
def spoof_tcp(pkt):
IPLayer = IP(dst=destIP, src=pkt[IP].dst)
TCPLayer = TCP(flags="R", seq=pkt[TCP].ack, dport=pkt[TCP].sport, sport=pkt[TCP].dport)
spoofpkt = IPLayer/TCPLa... | 22.695652 | 91 | 0.655172 | from scapy.all import *
from scapy.all import send
from scapy.layers.inet import *
srcIP = "192.168.0.103"
destIP = "192.168.0.108"
def spoof_tcp(pkt):
IPLayer = IP(dst=destIP, src=pkt[IP].dst)
TCPLayer = TCP(flags="R", seq=pkt[TCP].ack, dport=pkt[TCP].sport, sport=pkt[TCP].dport)
spoofpkt = IPLayer/TCPLa... | true | true |
f707da107d989b56c26b40432ff8a4818a50ba27 | 3,748 | py | Python | joswig_dijkstra.py | MrCopprHead/joswig | addd43e29270320e69d038ef5b24b717c2740061 | [
"MIT"
] | null | null | null | joswig_dijkstra.py | MrCopprHead/joswig | addd43e29270320e69d038ef5b24b717c2740061 | [
"MIT"
] | null | null | null | joswig_dijkstra.py | MrCopprHead/joswig | addd43e29270320e69d038ef5b24b717c2740061 | [
"MIT"
] | null | null | null | #Attempt to route using the Joswig Algorithm described here: https://arxiv.org/pdf/1904.01082.pdf
#using object oriented programming.
class Vertex:
num_vert = 0
vertices = []
def __init__(self, lab=""):
self.label = lab
self.adj = [] #adjacency list
self.weight = [] ... | 32.310345 | 98 | 0.509872 | class Vertex:
num_vert = 0
vertices = []
def __init__(self, lab=""):
self.label = lab
self.adj = [] self.weight = [] self.known = False self.pv = None self.dv = 0 self.help = False Vertex.num_vert += 1
... | true | true |
f707dabc00b526292b8df6dd3bfa36d64cc75e28 | 18,578 | py | Python | maya/packages/oop_maya/tools/rigging/no_flip_pole_vector_tool.py | nicholas-silveira/art_pipeline | 44eda0657d97977d3cdb09fb4c3aff62bd1457e6 | [
"BSD-3-Clause"
] | 11 | 2015-04-28T06:18:47.000Z | 2022-02-06T01:53:50.000Z | maya/packages/oop_maya/tools/rigging/ui/no_flip_pole_vector_ui.py | nicholas-silveira/art_pipeline | 44eda0657d97977d3cdb09fb4c3aff62bd1457e6 | [
"BSD-3-Clause"
] | null | null | null | maya/packages/oop_maya/tools/rigging/ui/no_flip_pole_vector_ui.py | nicholas-silveira/art_pipeline | 44eda0657d97977d3cdb09fb4c3aff62bd1457e6 | [
"BSD-3-Clause"
] | 6 | 2015-12-15T06:22:00.000Z | 2021-11-08T04:54:58.000Z | '''
I N S T A L L A T I O N::
Step 1:
Copy "no_flip_pole_vector_tool.py" to your Maya plugins directory.
Windows: C:\Users\UserName\Documents\maya\scripts
Step 2:
Run this in the Maya's Script Editor under the Python tab...
import no_flip_pole_vector_tool as nfpv
nfpv.No_Flip_Pole_Vector().show_ui()
If you have a... | 35.05283 | 159 | 0.576488 | '''
I N S T A L L A T I O N::
Step 1:
Copy "no_flip_pole_vector_tool.py" to your Maya plugins directory.
Windows: C:\Users\UserName\Documents\maya\scripts
Step 2:
Run this in the Maya's Script Editor under the Python tab...
import no_flip_pole_vector_tool as nfpv
nfpv.No_Flip_Pole_Vector().show_ui()
If you have a... | false | true |
f707dc3bea0d922a73defd241268b992e7ca7392 | 971 | py | Python | creational/singleton.py | rcavaz/Design-Patterns | d40718926be14a5da7e7deb3c6d31d5259eee1dd | [
"MIT"
] | 3 | 2018-01-12T01:45:00.000Z | 2019-03-07T20:12:23.000Z | creational/singleton.py | rcavaz/Design-Patterns | d40718926be14a5da7e7deb3c6d31d5259eee1dd | [
"MIT"
] | null | null | null | creational/singleton.py | rcavaz/Design-Patterns | d40718926be14a5da7e7deb3c6d31d5259eee1dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
SINGLETON
Use the Singleton pattern when:
1. there must be exactly one instance of a class, and it must be
accessible to clients from a well-known access point.
2. the sole instance should be extensible by subclassing, and clients
should be able to use an extended instan... | 28.558824 | 79 | 0.677652 | import logging
class Connection(object):
def __new__(type):
if not '_connection' in type.__dict__:
type._connection = object.__new__(type)
logging.basicConfig(level=logging.INFO)
logging.info('New database connection created!')
logging.info('Connection establis... | true | true |
f707dca08d914b63cf7af7cdfd1b67909756c739 | 1,597 | py | Python | nacos/base.py | hubertshelley/nacos_client_python | 38f9b4fe26096626328d5f2149b144b9b5933a11 | [
"Apache-2.0"
] | null | null | null | nacos/base.py | hubertshelley/nacos_client_python | 38f9b4fe26096626328d5f2149b144b9b5933a11 | [
"Apache-2.0"
] | null | null | null | nacos/base.py | hubertshelley/nacos_client_python | 38f9b4fe26096626328d5f2149b144b9b5933a11 | [
"Apache-2.0"
] | null | null | null | import socket
from http import HTTPStatus
from urllib.request import Request, urlopen, ProxyHandler, build_opener
from urllib.parse import urlencode, unquote_plus, quote, quote_plus
from urllib.error import HTTPError, URLError
class ClientBase:
def __init__(self, nacos_host: str, api_level: str = 'v1'):
s... | 38.95122 | 109 | 0.577959 | import socket
from http import HTTPStatus
from urllib.request import Request, urlopen, ProxyHandler, build_opener
from urllib.parse import urlencode, unquote_plus, quote, quote_plus
from urllib.error import HTTPError, URLError
class ClientBase:
def __init__(self, nacos_host: str, api_level: str = 'v1'):
s... | true | true |
f707dcc5768824ef0e014152f92bc6655d9355f0 | 657 | py | Python | tridentstream/notifiers/multinotifier/handler.py | tridentstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | 6 | 2020-01-03T14:50:09.000Z | 2021-09-13T01:44:31.000Z | tridentstream/notifiers/multinotifier/handler.py | tidalstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | null | null | null | tridentstream/notifiers/multinotifier/handler.py | tidalstream/mediaserver | 5d47d766df2e8dca076e41348062567a569019fd | [
"MIT"
] | null | null | null | import logging
from django.contrib.auth.models import User
from unplugged import RelatedPluginField, Schema, fields
from wampyre.realm import realm_manager
from ...plugins import NotifierPlugin
logger = logging.getLogger(__name__)
class MultiNotifierSchema(Schema):
notifiers = fields.List(
RelatedPlugi... | 26.28 | 79 | 0.762557 | import logging
from django.contrib.auth.models import User
from unplugged import RelatedPluginField, Schema, fields
from wampyre.realm import realm_manager
from ...plugins import NotifierPlugin
logger = logging.getLogger(__name__)
class MultiNotifierSchema(Schema):
notifiers = fields.List(
RelatedPlugi... | true | true |
f707dcef9260b20e07d25e398446967df4b622c2 | 1,410 | py | Python | elit/datasets/sts/stsb.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | 4 | 2021-09-17T15:23:31.000Z | 2022-02-28T10:18:04.000Z | elit/datasets/sts/stsb.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | elit/datasets/sts/stsb.py | emorynlp/stem-cell-hypothesis | 48a628093d93d653865fbac6409d179cddd99293 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2021-05-20 16:25
from typing import Union, List, Callable
from elit.common.dataset import TransformableDataset
from elit.utils.io_util import read_cells
STS_B_TRAIN = 'http://ixa2.si.ehu.es/stswiki/images/4/48/Stsbenchmark.tar.gz#sts-train.csv'
STS_B_DEV = 'http://ixa2.... | 38.108108 | 94 | 0.628369 | from typing import Union, List, Callable
from elit.common.dataset import TransformableDataset
from elit.utils.io_util import read_cells
STS_B_TRAIN = 'http://ixa2.si.ehu.es/stswiki/images/4/48/Stsbenchmark.tar.gz#sts-train.csv'
STS_B_DEV = 'http://ixa2.si.ehu.es/stswiki/images/4/48/Stsbenchmark.tar.gz#sts-dev.csv'
ST... | true | true |
f707ddcb48b0d243878fade85e7923d452e6caaf | 771 | py | Python | utils/censor.py | GlobalChatDev/DeveloperGlobalChat | 8f52e778e3730add307cfafbdb0e3b71a562462f | [
"MIT"
] | 4 | 2021-11-22T00:31:19.000Z | 2022-03-05T13:38:36.000Z | utils/censor.py | GlobalChatDev/DeveloperGlobalChat | 8f52e778e3730add307cfafbdb0e3b71a562462f | [
"MIT"
] | null | null | null | utils/censor.py | GlobalChatDev/DeveloperGlobalChat | 8f52e778e3730add307cfafbdb0e3b71a562462f | [
"MIT"
] | 1 | 2022-02-27T21:26:20.000Z | 2022-02-27T21:26:20.000Z | from typing import *
import re
class Censorship:
def __init__(self, content: Union[Any, str, None] = None) -> None:
self.content: str = content
def update_content(self, content: Any):
self.content = content
def censor(self):
censored = ["fuck", "shit", "lmao", "lmfao", "porn", "s... | 30.84 | 91 | 0.509728 | from typing import *
import re
class Censorship:
def __init__(self, content: Union[Any, str, None] = None) -> None:
self.content: str = content
def update_content(self, content: Any):
self.content = content
def censor(self):
censored = ["fuck", "shit", "lmao", "lmfao", "porn", "s... | true | true |
f707de3705af2a4dae494700ab92a8eb9604d0f0 | 389 | py | Python | opinions/united_states/state/ohioctapp_2.py | brianwc/juriscraper | f95221c3ab38ef89e642a3f5ed5569f73866d636 | [
"BSD-2-Clause"
] | null | null | null | opinions/united_states/state/ohioctapp_2.py | brianwc/juriscraper | f95221c3ab38ef89e642a3f5ed5569f73866d636 | [
"BSD-2-Clause"
] | null | null | null | opinions/united_states/state/ohioctapp_2.py | brianwc/juriscraper | f95221c3ab38ef89e642a3f5ed5569f73866d636 | [
"BSD-2-Clause"
] | null | null | null | """Scraper for the 1st District Court of Appeals
CourtID: ohio
Court Short Name: Ohio
Author: Andrei Chelaru
"""
from juriscraper.opinions.united_states.state import ohio
class Site(ohio.Site):
def __init__(self):
super(Site, self).__init__()
self.court_id = self.__module__
self.court_ind... | 24.3125 | 61 | 0.70437 |
from juriscraper.opinions.united_states.state import ohio
class Site(ohio.Site):
def __init__(self):
super(Site, self).__init__()
self.court_id = self.__module__
self.court_index = 2
self.url = self.make_url(self.court_index, self.year)
| true | true |
f707de5d7baf6c48523186021b7d2ca01cdbe868 | 220 | py | Python | tflib/__init__.py | nguyenquangduc2000/AttGAN | 2ba96d1a1f80b39cc785c594ad8e1d800c06dd52 | [
"MIT"
] | 405 | 2019-04-17T03:02:18.000Z | 2022-03-11T06:36:00.000Z | tflib/__init__.py | nguyenquangduc2000/AttGAN | 2ba96d1a1f80b39cc785c594ad8e1d800c06dd52 | [
"MIT"
] | 58 | 2019-05-13T09:34:57.000Z | 2021-12-07T08:40:58.000Z | tflib/__init__.py | nguyenquangduc2000/AttGAN | 2ba96d1a1f80b39cc785c594ad8e1d800c06dd52 | [
"MIT"
] | 95 | 2019-04-20T02:32:32.000Z | 2022-03-07T03:58:24.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tflib.checkpoint import *
from tflib.ops import *
from tflib.utils import *
from tflib.variable import *
| 24.444444 | 38 | 0.831818 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tflib.checkpoint import *
from tflib.ops import *
from tflib.utils import *
from tflib.variable import *
| true | true |
f707de66a1a318b60effa45ff1790f7b9c557bb8 | 116 | py | Python | holygun/bot.py | TitaniumHocker/Holygun | b1860ca7586c222e68ab79d1408126f757cc2057 | [
"MIT"
] | null | null | null | holygun/bot.py | TitaniumHocker/Holygun | b1860ca7586c222e68ab79d1408126f757cc2057 | [
"MIT"
] | null | null | null | holygun/bot.py | TitaniumHocker/Holygun | b1860ca7586c222e68ab79d1408126f757cc2057 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from discord.ext import commands
import discord
client = commands.Bot(command_prefix='.')
| 16.571429 | 41 | 0.706897 | from discord.ext import commands
import discord
client = commands.Bot(command_prefix='.')
| true | true |
f707dec50aebb6bb333e897656608d4ecdba6528 | 5,601 | py | Python | portfolio/Python/scrapy/gadgetpanda/sellusyourgadget_spider.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/gadgetpanda/sellusyourgadget_spider.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | null | null | null | portfolio/Python/scrapy/gadgetpanda/sellusyourgadget_spider.py | 0--key/lib | ba7a85dda2b208adc290508ca617bdc55a5ded22 | [
"Apache-2.0"
] | 5 | 2016-03-22T07:40:46.000Z | 2021-05-30T16:12:21.000Z | import os
import csv
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, FormRequest
from product_spiders.fuzzywuzzy import process
from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader
HERE = os.path.abspath(os.path.dirn... | 51.861111 | 119 | 0.466702 | import os
import csv
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, FormRequest
from product_spiders.fuzzywuzzy import process
from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader
HERE = os.path.abspath(os.path.dirn... | true | true |
f707dfbc174261fab6b852262aa102e8664820a1 | 1,335 | py | Python | src/python/WMCore/BossAir/MySQL/LoadForMonitoring.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/WMCore/BossAir/MySQL/LoadForMonitoring.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/WMCore/BossAir/MySQL/LoadForMonitoring.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | #!/usr/bin/env python
"""
_LoadForMonitoring_
MySQL implementation for loading a job by scheduler status
"""
from WMCore.Database.DBFormatter import DBFormatter
class LoadForMonitoring(DBFormatter):
"""
_LoadForMonitoring_
Load all jobs with a certain scheduler status including
all the joined infor... | 28.404255 | 86 | 0.617978 |
from WMCore.Database.DBFormatter import DBFormatter
class LoadForMonitoring(DBFormatter):
sql = """SELECT rj.wmbs_id AS jobid, rj.grid_id AS gridid, rj.bulk_id AS bulkid,
st.name AS status, rj.retry_count as retry_count, rj.id AS id,
rj.status_time as status_time, wl.plugin AS plu... | true | true |
f707e00a97a99d4a6c312d59ee4e46abeccbb04f | 407 | py | Python | myscraper/spiders/myscraper.py | melki/scrapeSlate | f1583e49e29cef6670a1f390f918207fa63646a5 | [
"MIT"
] | null | null | null | myscraper/spiders/myscraper.py | melki/scrapeSlate | f1583e49e29cef6670a1f390f918207fa63646a5 | [
"MIT"
] | null | null | null | myscraper/spiders/myscraper.py | melki/scrapeSlate | f1583e49e29cef6670a1f390f918207fa63646a5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from scrapy import Spider, Request
from ..items import Article
from ..items import Lien
class MyScraper(Spider):
name = u'myscraper'
def start_requests(self):
urlToVisit = {}
Request(
url='http://www.google.fr/',
callback=self.parse,
... | 16.958333 | 40 | 0.55774 |
from scrapy import Spider, Request
from ..items import Article
from ..items import Lien
class MyScraper(Spider):
name = u'myscraper'
def start_requests(self):
urlToVisit = {}
Request(
url='http://www.google.fr/',
callback=self.parse,
)
def parse(self, ... | true | true |
f707e1277f32bfebfdc9ac2cf05c0ae86aa33b5f | 8,465 | py | Python | docs/conf.py | liuzh91/gluon-nlp | 189bbdcc56d8e58aa908963949687b99ff9a3cff | [
"Apache-2.0"
] | 1 | 2021-06-17T12:59:25.000Z | 2021-06-17T12:59:25.000Z | docs/conf.py | liuzh91/gluon-nlp | 189bbdcc56d8e58aa908963949687b99ff9a3cff | [
"Apache-2.0"
] | 3 | 2020-09-01T05:45:57.000Z | 2020-10-22T23:14:20.000Z | docs/conf.py | ZiyueHuang/gluon-nlp | 0d5c61992180f41eab590e74c7b679980f429292 | [
"Apache-2.0"
] | 1 | 2020-09-04T22:28:31.000Z | 2020-09-04T22:28:31.000Z | # documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 23 19:40:08 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a def... | 31.823308 | 100 | 0.695334 | import sys
import os, subprocess
import shlex
import recommonmark
import sphinx_gallery
from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
sys.path.insert(0, os.path.join(curr_path, '..'))
import... | true | true |
f707e18686892825bbfde8338065f25653edad29 | 4,210 | py | Python | analysis/coarse_graining.py | yketa/UBC---Spring-2018---code | b065544639a483dda48cda89bcbb11c1772232aa | [
"MIT"
] | 1 | 2021-12-15T13:38:13.000Z | 2021-12-15T13:38:13.000Z | analysis/coarse_graining.py | yketa/UBC---Spring-2018---code | b065544639a483dda48cda89bcbb11c1772232aa | [
"MIT"
] | 1 | 2019-05-25T20:00:17.000Z | 2019-05-25T20:00:17.000Z | analysis/coarse_graining.py | yketa/UBC---Spring-2018---code | b065544639a483dda48cda89bcbb11c1772232aa | [
"MIT"
] | 1 | 2020-01-22T17:05:18.000Z | 2020-01-22T17:05:18.000Z | """
Module coarse_graining implements a Gaussian coarse-graining adapted from
Illing et al., Phys. Rev. Lett. 117, 208002 (2016) following Goldhirsch and
Goldenberg, Eur. Phys. J. E 9, 245β251 (2002).
"""
import numpy as np
class GaussianCG:
"""
Gaussian coarse-graining.
"""
def __init__(self, sigma,... | 26.987179 | 117 | 0.539905 |
import numpy as np
class GaussianCG:
def __init__(self, sigma, r_cut):
self.sigma = sigma self.r_cut = r_cut
def function(self, r):
if r > self.r_cut: return 0
Dg = 2*np.pi*(self.sigma**2)*(1 -
np.exp(-0.5*((self.r_cut/self.sigma)**2))) return np.exp... | true | true |
f707e18b95fefa6dc45d4e780606b33415022b2a | 1,715 | py | Python | test/functional/feature_uacomment.py | dogxteam/dogxwallet-master | 346189354bdec9a80c20bdc429ddec15c3b17b73 | [
"MIT"
] | 5 | 2019-03-18T02:14:20.000Z | 2019-03-21T17:08:27.000Z | test/functional/feature_uacomment.py | dogxteam/dogxwallet-master | 346189354bdec9a80c20bdc429ddec15c3b17b73 | [
"MIT"
] | null | null | null | test/functional/feature_uacomment.py | dogxteam/dogxwallet-master | 346189354bdec9a80c20bdc429ddec15c3b17b73 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The dogxcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -uacomment option."""
import re
from test_framework.test_framework import dogxcoinTestFrame... | 41.829268 | 150 | 0.689213 |
import re
from test_framework.test_framework import dogxcoinTestFramework
from test_framework.test_node import ErrorMatch
from test_framework.util import assert_equal
class UacommentTest(dogxcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
def ... | true | true |
f707e23b55d940cd1262516340bb49b3d5e18399 | 2,673 | py | Python | tests/services/schemas/test_access.py | inveniosoftware/invenio-datacite | d25e3670b74f132390fc42e5647765ae5c605ef3 | [
"MIT"
] | 10 | 2020-01-17T10:13:09.000Z | 2022-03-17T10:14:41.000Z | tests/services/schemas/test_access.py | inveniosoftware/invenio-datacite | d25e3670b74f132390fc42e5647765ae5c605ef3 | [
"MIT"
] | 570 | 2019-08-15T16:35:25.000Z | 2022-03-31T13:46:17.000Z | tests/services/schemas/test_access.py | inveniosoftware/invenio-datacite | d25e3670b74f132390fc42e5647765ae5c605ef3 | [
"MIT"
] | 57 | 2019-09-04T09:25:29.000Z | 2022-03-30T19:32:55.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020-2021 CERN.
# Copyright (C) 2020-2021 Northwestern University.
# Copyright (C) 2021 TU Wien.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Test metadata ac... | 28.136842 | 79 | 0.601571 |
import pytest
from marshmallow.exceptions import ValidationError
from invenio_rdm_records.services.schemas.access import AccessSchema, \
EmbargoSchema
def test_embargo_load_no_until_is_valid():
expected = {
"active": False,
"until": None,
"reason": None
}
valid_no_until = {... | true | true |
f707e290501f737b5f06362e4618ddaa662ecadb | 833 | py | Python | mac.py | dssantos/Cloud-Energy-Saver | d30f6c421a3a8126f1ecda43a03006f2f83ddc55 | [
"MIT"
] | null | null | null | mac.py | dssantos/Cloud-Energy-Saver | d30f6c421a3a8126f1ecda43a03006f2f83ddc55 | [
"MIT"
] | null | null | null | mac.py | dssantos/Cloud-Energy-Saver | d30f6c421a3a8126f1ecda43a03006f2f83ddc55 | [
"MIT"
] | 1 | 2019-06-18T12:18:25.000Z | 2019-06-18T12:18:25.000Z | #coding: utf-8
import subprocess, string, ast
def get(host):
file = open("%s.txt"%host, "r+")
macs = file.read()
macs = ast.literal_eval(macs)
return macs
def set(host):
macs = []
command1 = "ssh user@%s 'ls /sys/class/net'" %host
try:
list_intefaces = subprocess.check_output(command1, shell=True)
list... | 23.138889 | 109 | 0.686675 |
import subprocess, string, ast
def get(host):
file = open("%s.txt"%host, "r+")
macs = file.read()
macs = ast.literal_eval(macs)
return macs
def set(host):
macs = []
command1 = "ssh user@%s 'ls /sys/class/net'" %host
try:
list_intefaces = subprocess.check_output(command1, shell=True)
list_intefaces = st... | false | true |
f707e2b06dbe69bf58625f3d2057eaab1323eae7 | 2,467 | py | Python | src/movement/dc_with_ultra.py | Quanta-Robotics/Robot-Blueberry | 7b7e77e09ac5e9ec5afd947e0db1ecc8773e56da | [
"MIT"
] | 25 | 2021-06-08T07:09:30.000Z | 2021-12-30T06:28:35.000Z | src/movement/dc_with_ultra.py | ICT-CoU/Robot-Blueberry | d19fd1be037df9d67de64df57a87006d74cd6c43 | [
"MIT"
] | 2 | 2021-05-23T12:54:51.000Z | 2021-06-07T17:47:56.000Z | src/movement/dc_with_ultra.py | ICT-CoU/Robot-Blueberry | d19fd1be037df9d67de64df57a87006d74cd6c43 | [
"MIT"
] | 14 | 2021-06-08T13:02:28.000Z | 2021-12-30T20:07:18.000Z | from expression import *
# programming the GPIO by BCM pin numbers
#TRIG = servo['Sensor']['ultrasonic']['trigger']
#ECHO = servo['Sensor']['ultrasonic']['echo']
TRIG = 24
ECHO = 23
GPIO.setup(TRIG,GPIO.OUT) # initialize GPIO Pin as outputs
GPIO.setup(ECHO,GPIO.IN) # initialize GPIO... | 28.034091 | 108 | 0.511147 | from expression import *
TRIG = 24
ECHO = 23
GPIO.setup(TRIG,GPIO.OUT) GPIO.setup(ECHO,GPIO.IN)
def forward():
Run(1,0,1,0,80)
def back():
Run(0,1,0,1,80)
def left():
Run(0,1,1,0,80)
def right():
Run(1,0,0,1,80)
Stop()
count=0
def Distance():
avgDistance=0
... | true | true |
f707e323b5012ccf55f0e28d9d20cc066ceefb85 | 1,916 | py | Python | tamusers/management/commands/sync_tamusers.py | Tampere/django-tamusers | 5b3d82332c435990dad98f64bb9094cc1502b7ef | [
"BSD-2-Clause"
] | null | null | null | tamusers/management/commands/sync_tamusers.py | Tampere/django-tamusers | 5b3d82332c435990dad98f64bb9094cc1502b7ef | [
"BSD-2-Clause"
] | 1 | 2020-04-20T14:05:28.000Z | 2020-04-20T14:05:28.000Z | tamusers/management/commands/sync_tamusers.py | Tampere/django-tamusers | 5b3d82332c435990dad98f64bb9094cc1502b7ef | [
"BSD-2-Clause"
] | null | null | null | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand
from django.contrib.sites.models import Site
from allauth.socialaccount.models import SocialApp
from tamusers.providers.tampere.provider import TampereProvider
class Command(Bas... | 36.150943 | 114 | 0.653967 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand
from django.contrib.sites.models import Site
from allauth.socialaccount.models import SocialApp
from tamusers.providers.tampere.provider import TampereProvider
class Command(Bas... | true | true |
f707e4491d0edf77917437d57d826e828a2fb974 | 19,684 | py | Python | cirq-core/cirq/work/observable_measurement_data_test.py | Nexuscompute/Cirq | 640ef8f82d6a56ec95361388ce7976e096cca906 | [
"Apache-2.0"
] | 1 | 2022-02-05T22:17:39.000Z | 2022-02-05T22:17:39.000Z | cirq-core/cirq/work/observable_measurement_data_test.py | pavoljuhas/Cirq | b6d6577be61d216ce2f29f8c64ae5879cf3087d5 | [
"Apache-2.0"
] | 4 | 2022-01-16T14:12:15.000Z | 2022-02-24T03:58:46.000Z | cirq-core/cirq/work/observable_measurement_data_test.py | Nexuscompute/Cirq | 640ef8f82d6a56ec95361388ce7976e096cca906 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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.024911 | 96 | 0.624416 | import dataclasses
import datetime
import time
import numpy as np
import pytest
import cirq
import cirq.work as cw
from cirq.work.observable_measurement_data import (
_check_and_get_real_coef,
_obs_vals_from_measurements,
_stats_from_measurements,
)
from cirq.work.observable_settings import _MeasurementSp... | true | true |
f707e5ac07ee0b8d1e609c00662e283e6331f036 | 1,500 | py | Python | vnpy_huobi/__init__.py | noranhe/vnpy_huobi | 9f4a8abe9c6716492fccec6a58bb1e054490b8c2 | [
"MIT"
] | null | null | null | vnpy_huobi/__init__.py | noranhe/vnpy_huobi | 9f4a8abe9c6716492fccec6a58bb1e054490b8c2 | [
"MIT"
] | null | null | null | vnpy_huobi/__init__.py | noranhe/vnpy_huobi | 9f4a8abe9c6716492fccec6a58bb1e054490b8c2 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2015-present, Xiaoyou Chen
#
# 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, c... | 42.857143 | 80 | 0.795333 |
import importlib_metadata
from .huobi_spot_gateway import HuobiSpotGateway
from .huobi_futures_gateway import HuobiFuturesGateway
from .huobi_usdt_gateway import HuobiUsdtGateway
from .huobi_inverse_gateway import HuobiInverseGateway
try:
__version__ = importlib_metadata.version("vnpy_huobi")
except importlib_m... | true | true |
f707e6c6f2ac68269e1fde45795c241baa227632 | 1,449 | py | Python | sourcecode/src/vx/pgff/BaseHandler.py | RianWoods/GFF | 930fa65bada68e8dd5c254535d0cb36c79f7781f | [
"MIT"
] | null | null | null | sourcecode/src/vx/pgff/BaseHandler.py | RianWoods/GFF | 930fa65bada68e8dd5c254535d0cb36c79f7781f | [
"MIT"
] | null | null | null | sourcecode/src/vx/pgff/BaseHandler.py | RianWoods/GFF | 930fa65bada68e8dd5c254535d0cb36c79f7781f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Ivar Vargas Belizario
# Copyright (c) 2020
# E-mail: ivar@usp.br
import tornado.ioloop
import tornado.web
import tornado.httpserver
import uuid
from vx.pgff.Settings import *
class BaseHandler(tornado.web.RequestHandler):
def set_defa... | 28.411765 | 78 | 0.620428 |
import tornado.ioloop
import tornado.web
import tornado.httpserver
import uuid
from vx.pgff.Settings import *
class BaseHandler(tornado.web.RequestHandler):
def set_default_headers(self):
self.set_header("Access-Control-Allow-Origin", "*")
self.set_header("Access-Control-Allow... | false | true |
f707e851434ea098122462fc160ade2093d6c2f0 | 35,468 | py | Python | frontends/etiquette_cli.py | voussoir/etiquette | e982858c28335b11528c52af181abd1bbc71673f | [
"BSD-3-Clause"
] | 20 | 2018-03-20T01:40:13.000Z | 2022-02-11T20:23:41.000Z | frontends/etiquette_cli.py | voussoir/etiquette | e982858c28335b11528c52af181abd1bbc71673f | [
"BSD-3-Clause"
] | null | null | null | frontends/etiquette_cli.py | voussoir/etiquette | e982858c28335b11528c52af181abd1bbc71673f | [
"BSD-3-Clause"
] | 1 | 2018-03-20T13:10:31.000Z | 2018-03-20T13:10:31.000Z | import argparse
import os
import re
import sys
from voussoirkit import betterhelp
from voussoirkit import interactive
from voussoirkit import pathclass
from voussoirkit import pipeable
from voussoirkit import spinal
from voussoirkit import stringtools
from voussoirkit import vlogging
import etiquette
# HELPERS #####... | 33.054986 | 129 | 0.687662 | import argparse
import os
import re
import sys
from voussoirkit import betterhelp
from voussoirkit import interactive
from voussoirkit import pathclass
from voussoirkit import pipeable
from voussoirkit import spinal
from voussoirkit import stringtools
from voussoirkit import vlogging
import etiquette
def export_sym... | true | true |
f707e8b56ef15989602ef9fa6ae6524c8a27ce3b | 7,549 | py | Python | python/tests/wrapper/test_05_multimodal.py | menshikh-iv/bigartm | 9be401f740402814fe79ff4a6cebfd3db0bf992f | [
"BSD-3-Clause"
] | 638 | 2015-02-03T22:17:00.000Z | 2022-03-23T18:47:50.000Z | python/tests/wrapper/test_05_multimodal.py | menshikh-iv/bigartm | 9be401f740402814fe79ff4a6cebfd3db0bf992f | [
"BSD-3-Clause"
] | 566 | 2015-01-01T21:49:00.000Z | 2022-02-14T09:14:35.000Z | python/tests/wrapper/test_05_multimodal.py | bt2901/bigartm | 92c9d5746c122d0124bab700469d8a2a7f58ff40 | [
"BSD-3-Clause"
] | 148 | 2015-01-06T15:30:07.000Z | 2022-02-12T18:40:17.000Z | # -*- coding: utf-8 -*-
# Copyright 2017, Additive Regularization of Topic Models.
from __future__ import print_function
import os
import uuid
import string
import itertools
import tempfile
import shutil
import pytest
from six.moves import range, zip
import artm.wrapper
import artm.wrapper.messages_pb2 as messages... | 37.371287 | 108 | 0.616903 |
from __future__ import print_function
import os
import uuid
import string
import itertools
import tempfile
import shutil
import pytest
from six.moves import range, zip
import artm.wrapper
import artm.wrapper.messages_pb2 as messages
import artm.master_component as mc
def _print_top_tokens(top_tokens_score, expect... | true | true |
f707e8d92417a3709eee2909a385d1cc48e469bf | 213 | py | Python | src/accounts/models.py | rafaellcoellho/pergunteme | df60823c311657a85d54eedbef4c95997c17e9b7 | [
"MIT"
] | null | null | null | src/accounts/models.py | rafaellcoellho/pergunteme | df60823c311657a85d54eedbef4c95997c17e9b7 | [
"MIT"
] | null | null | null | src/accounts/models.py | rafaellcoellho/pergunteme | df60823c311657a85d54eedbef4c95997c17e9b7 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractUser
class CustomUser(AbstractUser):
pass
# add additional fields in here
def __str__(self):
return self.username
| 19.363636 | 51 | 0.737089 | from django.db import models
from django.contrib.auth.models import AbstractUser
class CustomUser(AbstractUser):
pass
def __str__(self):
return self.username
| true | true |
f707e905c648029218b894bbf864fc1a6ff9b8b7 | 931 | py | Python | 04/code/kmp.py | libchaos/algorithm-python | 9d5635e19c58c75bf1f14a3fba9d7340f77df863 | [
"MIT"
] | 2 | 2018-03-14T21:57:10.000Z | 2019-07-18T08:47:28.000Z | 04/code/kmp.py | libchaos/algorithm-python | 9d5635e19c58c75bf1f14a3fba9d7340f77df863 | [
"MIT"
] | null | null | null | 04/code/kmp.py | libchaos/algorithm-python | 9d5635e19c58c75bf1f14a3fba9d7340f77df863 | [
"MIT"
] | 2 | 2018-06-20T14:56:31.000Z | 2022-02-15T05:27:11.000Z |
# while j < n and i < m:
# if i == -1 or t[j] == p[i]:
# j, i = j+1, i+1
# else:
# i = pnext[i]
def matching_KMP(t, p, pnext):
j, i = 0, 0
n, m = len(t), len(p)
while j < n and i < m:
if i == -1 or t[j] == p[i]:
j, i = j+1, i+1
else:
i = pn... | 19.808511 | 35 | 0.344791 |
def matching_KMP(t, p, pnext):
j, i = 0, 0
n, m = len(t), len(p)
while j < n and i < m:
if i == -1 or t[j] == p[i]:
j, i = j+1, i+1
else:
i = pnext[i]
if i == m:
return j-i
return -1
def gen_pnext(p):
i, k, m = 0, -1, len(p)
pnext = [-1] *... | false | true |
f707e9b1b9ea3839eac0a69112f41e93fa9c360a | 1,447 | py | Python | general_modules/postprocess_decoded_seq.py | johntsi/preast_qa | e95fb167f4fdeb8868fed935f88493450ea10ddd | [
"MIT"
] | null | null | null | general_modules/postprocess_decoded_seq.py | johntsi/preast_qa | e95fb167f4fdeb8868fed935f88493450ea10ddd | [
"MIT"
] | null | null | null | general_modules/postprocess_decoded_seq.py | johntsi/preast_qa | e95fb167f4fdeb8868fed935f88493450ea10ddd | [
"MIT"
] | null | null | null | def postprocess_decoded_seq(answers):
"""
Corrects for some extra spaces that are created by the decode method
of the tokenizer like in numerical strings
example: 1, 000, 000 --> 1,000,000
Args:
answers: list[str]
Returns:
new_answers: list[str]
"""
new_answers = []
for answer in answers:
parts = an... | 22.968254 | 69 | 0.565999 | def postprocess_decoded_seq(answers):
new_answers = []
for answer in answers:
parts = answer.split(", ")
if len(parts) > 1:
try:
new0 = parts[0]
for i in range(1, len(parts)):
if new0[-1].isnumeric() and parts[i][0].isnumeric():
if len(parts[i]) > 3 and parts[i][3].isnumeric():
ne... | true | true |
f707ec62b70359ffbd3ab48f3f38674053d85189 | 10,193 | py | Python | omop_harvest/conf/base.py | chop-dbhi/omop_harvest | ed2f5101941b48ea1a76761ae05162b89ead5bb7 | [
"BSD-2-Clause"
] | 4 | 2015-01-21T13:48:33.000Z | 2017-02-22T15:22:39.000Z | omop_harvest/conf/base.py | chop-dbhi/omop_harvest | ed2f5101941b48ea1a76761ae05162b89ead5bb7 | [
"BSD-2-Clause"
] | 2 | 2015-01-29T19:24:24.000Z | 2015-04-10T21:04:53.000Z | omop_harvest/conf/base.py | chop-dbhi/omop_harvest | ed2f5101941b48ea1a76761ae05162b89ead5bb7 | [
"BSD-2-Clause"
] | 2 | 2015-01-28T01:07:01.000Z | 2015-07-22T17:36:21.000Z | import os
# Import global settings to make it easier to extend settings.
from django.conf.global_settings import *
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
""" Get the environment variable or return an exception"""
try:
return os.environ[var_name]
exc... | 26.613577 | 81 | 0.672913 | import os
from django.conf.global_settings import *
from django.core.exceptions import ImproperlyConfigured
def get_env_variable(var_name):
try:
return os.environ[var_name]
except KeyError:
error_msg = "Set the %s environment variable" % var_name
raise ImproperlyConfigured(error_msg)
... | true | true |
f707ed0c7e8ee188d0347cf515666d3fbef96b5e | 1,580 | py | Python | wsltools/similar.py | Symbo1/wsltools | 0b6e536fc85c707a1c81f0296c4e91ca835396a1 | [
"MIT"
] | 412 | 2020-04-16T08:11:58.000Z | 2022-02-02T19:49:53.000Z | wsltools/similar.py | Symbo1/wsltools | 0b6e536fc85c707a1c81f0296c4e91ca835396a1 | [
"MIT"
] | 1 | 2020-04-16T14:03:46.000Z | 2020-04-17T03:41:18.000Z | wsltools/similar.py | Symbo1/wsltools | 0b6e536fc85c707a1c81f0296c4e91ca835396a1 | [
"MIT"
] | 33 | 2020-04-16T08:48:53.000Z | 2021-10-20T04:39:29.000Z | # -*- coding: utf-8 -*-
__author__ = 'CongRong <tr3jer@gmail.com>'
import difflib
from .utils.compat import bytes_decode, xrange
hashbits = 128
difflib_threshold = 0.95
simhash_threshold = 0.95
def simhash(tokens):
v = [0] * hashbits
for t in [string_hash(x) for x in tokens]:
for i in xrange(hashbits):
bi... | 19.268293 | 100 | 0.643038 |
__author__ = 'CongRong <tr3jer@gmail.com>'
import difflib
from .utils.compat import bytes_decode, xrange
hashbits = 128
difflib_threshold = 0.95
simhash_threshold = 0.95
def simhash(tokens):
v = [0] * hashbits
for t in [string_hash(x) for x in tokens]:
for i in xrange(hashbits):
bitmask = 1 << i
if t &... | true | true |
f707edd2b040f0802a1354f8b3a12e88d8aee693 | 58 | py | Python | essentials/hello.py | ariannasg/python3-essential-training | 9b52645f5ccb57d2bda5d5f4a3053681a026450a | [
"MIT"
] | 1 | 2020-06-02T08:37:41.000Z | 2020-06-02T08:37:41.000Z | essentials/hello.py | ariannasg/python3-training | 9b52645f5ccb57d2bda5d5f4a3053681a026450a | [
"MIT"
] | null | null | null | essentials/hello.py | ariannasg/python3-training | 9b52645f5ccb57d2bda5d5f4a3053681a026450a | [
"MIT"
] | null | null | null | print('Hello, World.')
# CONSOLE OUTPUT:
# Hello, World.
| 11.6 | 22 | 0.655172 | print('Hello, World.')
| true | true |
f707ef2ead5ec54c7eb2427bced3cc02f631c7dd | 31,651 | py | Python | request.py | alexcornier/INSEE | a5dc6e1267834754ac1cd1331203b5e835828946 | [
"MIT"
] | 1 | 2020-08-25T16:20:03.000Z | 2020-08-25T16:20:03.000Z | request.py | alexcornier/INSEE | a5dc6e1267834754ac1cd1331203b5e835828946 | [
"MIT"
] | null | null | null | request.py | alexcornier/INSEE | a5dc6e1267834754ac1cd1331203b5e835828946 | [
"MIT"
] | null | null | null | #================================================================
# Ensemble de requΓͺtes SQL sur une base de donnΓ©es SQL
# hΓ©bergΓ©es sur un serveur local postgresql
#
# Modules pythons nΓ©cessaires
# psycopg2 (SQL connection)
# pandas (DataFrame et HTML)
# matplotlib
# jinja2 (styles HTML)
#
# Alexandre Cornier ... | 45.02276 | 138 | 0.563616 |
import psycopg2
import pandas as pd
import webbrowser
import pathlib
bconsole = False # pas d'affichage console par dΓ©faut
connection = psycopg2.connect("host=localhost port=5432 dbname=cremi user=postgres password=Audierne")
cur = connection.cursor()
def affiche_html(titre_question, question, fichier, resultat_ht... | true | true |
f707ef923ffadab284cc2684037cfd93b6bc232f | 18,285 | py | Python | lib/doFormatCheckDIF.py | joser1945/cmr-metadata-review | df0bb24dd06f981af907569f1a97966753053a99 | [
"Apache-2.0"
] | 15 | 2018-06-26T19:58:44.000Z | 2022-03-01T21:19:34.000Z | lib/doFormatCheckDIF.py | joser1945/cmr-metadata-review | df0bb24dd06f981af907569f1a97966753053a99 | [
"Apache-2.0"
] | 61 | 2018-06-27T15:15:41.000Z | 2022-03-08T15:39:32.000Z | lib/doFormatCheckDIF.py | vbjayanti/cmr-metadata-review | 1c7ac12ef26f144289e3004588a2e2b305d4f940 | [
"Apache-2.0"
] | 9 | 2019-01-22T15:48:48.000Z | 2021-10-01T18:38:30.000Z | '''
Copyright 2016, United States Government, as represented by the Administrator of
the National Aeronautics and Space Administration. All rights reserved.
The "pyCMR" platform is licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may ... | 122.718121 | 9,943 | 0.762811 |
import os, errno
import json
import CollectionCheckerDIF
from cmr import searchCollection
from xml.etree import ElementTree
from xmlParser import XmlDictConfigDIF
from xmlParser import XmlDictConfig
collection_output_header = 'DIF10 Collection Elements,\
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\
,,,,,,,,,,,,,,,,,,,,,,... | true | true |
f707eff3e3f76431a210c5b3441c3dfca87b5471 | 3,463 | py | Python | code/storyboard.py | athna/cytrone | b37c8f249d27c786028595493887f9f0ecbeae39 | [
"BSD-3-Clause"
] | 1 | 2020-04-23T02:09:45.000Z | 2020-04-23T02:09:45.000Z | code/storyboard.py | LiteraryProgrammer/cytrone | 93577d13de6102a61fbc306639253250847de537 | [
"BSD-3-Clause"
] | null | null | null | code/storyboard.py | LiteraryProgrammer/cytrone | 93577d13de6102a61fbc306639253250847de537 | [
"BSD-3-Clause"
] | null | null | null |
#############################################################################
# Classes related to the CyTrONE storyboard
#############################################################################
class Storyboard:
# Global configuration flags
ENABLE_HTTPS = True
ENABLE_PASSWORD = True
# Separato... | 47.438356 | 127 | 0.689287 |
class Storyboard:
ENABLE_HTTPS = True
ENABLE_PASSWORD = True
SEPARATOR1 = "-------------------------------------------------------------------------"
SEPARATOR2 = "========================================================================="
SEPARATOR3 = "###################################... | true | true |
f707f0123f7df4e31a7504a3e66c201f5f811ebd | 3,574 | py | Python | pgAdmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete_multiple.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete_multiple.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/browser/server_groups/servers/databases/foreign_data_wrappers/tests/test_fdw_delete_multiple.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
from __future__ i... | 46.415584 | 78 | 0.535534 |
from __future__ import print_function
import uuid
import json
from pgadmin.browser.server_groups.servers.databases.tests import \
utils as database_utils
from pgadmin.utils.route import BaseTestGenerator
from regression import parent_node_dict
from regression.python_test_utils import test_utils as utils
from . i... | true | true |
f707f1254d79d55178ea62e6f1135f1d5e0e002b | 30,174 | py | Python | discord_slash/context.py | RedstoneZockt/discord-py-interactions | 5ddbd4f303e14787e16a2c906bccd1a4e828ef6c | [
"MIT"
] | null | null | null | discord_slash/context.py | RedstoneZockt/discord-py-interactions | 5ddbd4f303e14787e16a2c906bccd1a4e828ef6c | [
"MIT"
] | null | null | null | discord_slash/context.py | RedstoneZockt/discord-py-interactions | 5ddbd4f303e14787e16a2c906bccd1a4e828ef6c | [
"MIT"
] | null | null | null | import datetime
import typing
from typing import TYPE_CHECKING
from warnings import warn
import discord
from discord.ext import commands
from discord.utils import snowflake_time
from . import error, http, model
from .dpy_overrides import ComponentMessage
if TYPE_CHECKING: # circular import sucks for typehinting
... | 39.034929 | 183 | 0.598562 | import datetime
import typing
from typing import TYPE_CHECKING
from warnings import warn
import discord
from discord.ext import commands
from discord.utils import snowflake_time
from . import error, http, model
from .dpy_overrides import ComponentMessage
if TYPE_CHECKING: from . import client
class Interactio... | true | true |
f707f24af08406bad7adef31a302134e4dc66c93 | 6,102 | py | Python | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/utils/metrics_hook_test.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 44 | 2018-11-07T18:52:33.000Z | 2019-07-06T12:48:18.000Z | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/utils/metrics_hook_test.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 63 | 2017-12-19T20:29:10.000Z | 2021-08-04T21:49:36.000Z | v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/utils/metrics_hook_test.py | myelintek/results | 11c38436a158c453e3011f8684570f7a55c03330 | [
"Apache-2.0"
] | 44 | 2018-11-09T21:04:52.000Z | 2019-06-24T07:40:28.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | 31.132653 | 80 | 0.683219 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import os
import shutil
from tensor2tensor.utils import metrics_hook
import tensorflow as tf
class DummyHook(metrics_hook.MetricsBasedHook):
def _process_metrics(self, global_step, met... | true | true |
f707f2d1609dcbab7ff45a0d3a1b347d509c7995 | 41,314 | py | Python | torchbiggraph/train_cpu.py | stillmatic/PyTorch-BigGraph | d7d6576281faa54ec5850e204ffc07b1268fdb04 | [
"BSD-3-Clause"
] | 3 | 2020-09-10T15:03:20.000Z | 2020-09-13T17:38:31.000Z | torchbiggraph/train_cpu.py | stillmatic/PyTorch-BigGraph | d7d6576281faa54ec5850e204ffc07b1268fdb04 | [
"BSD-3-Clause"
] | null | null | null | torchbiggraph/train_cpu.py | stillmatic/PyTorch-BigGraph | d7d6576281faa54ec5850e204ffc07b1268fdb04 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T03:27:48.000Z | 2022-01-11T03:27:48.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE.txt file in the root directory of this source tree.
import logging
import math
import time
from collections import defaultdict
from funct... | 41.314 | 125 | 0.596819 |
import logging
import math
import time
from collections import defaultdict
from functools import partial
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple
import torch
import torch.distributed as td
from torch.optim import Optimizer
from torchbiggraph.async_adagrad import AsyncAdagrad
from... | true | true |
f707f2e3b19fb24668146e651f30715302cff2ea | 886 | py | Python | setup.py | nurikk/icloud_photos_downloader | d159b13e43a7ad216e88e7a6aa7641cd2af5615f | [
"MIT"
] | null | null | null | setup.py | nurikk/icloud_photos_downloader | d159b13e43a7ad216e88e7a6aa7641cd2af5615f | [
"MIT"
] | null | null | null | setup.py | nurikk/icloud_photos_downloader | d159b13e43a7ad216e88e7a6aa7641cd2af5615f | [
"MIT"
] | 1 | 2019-12-22T06:14:20.000Z | 2019-12-22T06:14:20.000Z | from setuptools import setup, find_packages
with open("requirements.txt") as f:
required = f.read().splitlines()
setup(
name="icloudpd",
version="1.4.3",
url="https://github.com/ndbroadbent/icloud_photos_downloader",
description=(
"icloudpd is a command-line tool to download photos and vid... | 31.642857 | 84 | 0.65237 | from setuptools import setup, find_packages
with open("requirements.txt") as f:
required = f.read().splitlines()
setup(
name="icloudpd",
version="1.4.3",
url="https://github.com/ndbroadbent/icloud_photos_downloader",
description=(
"icloudpd is a command-line tool to download photos and vid... | true | true |
f707f2fa90d4f7a0f5673b62cd8e5c20008c595e | 1,648 | py | Python | setup.py | jeffshurtliff/khorosjx | 1530fad25eb8ccefcbb5a9ae63c09a6858cb033d | [
"MIT"
] | 2 | 2019-11-18T03:52:51.000Z | 2020-12-30T04:08:06.000Z | setup.py | jeffshurtliff/khorosjx | 1530fad25eb8ccefcbb5a9ae63c09a6858cb033d | [
"MIT"
] | 2 | 2019-12-17T17:02:30.000Z | 2021-06-02T13:56:02.000Z | setup.py | jeffshurtliff/khorosjx | 1530fad25eb8ccefcbb5a9ae63c09a6858cb033d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import setuptools
import khorosjx.utils.version
with open("README.md", "r") as fh:
long_description = fh.read()
version = khorosjx.utils.version.__version__
setuptools.setup(
name="khorosjx",
version=version,
author="Jeff Shurtliff",
author_email="jeff.shurtliff@rsa.com"... | 34.333333 | 118 | 0.62682 |
import setuptools
import khorosjx.utils.version
with open("README.md", "r") as fh:
long_description = fh.read()
version = khorosjx.utils.version.__version__
setuptools.setup(
name="khorosjx",
version=version,
author="Jeff Shurtliff",
author_email="jeff.shurtliff@rsa.com",
description="Usefu... | true | true |
f707f3249684f30c3709d6e9af33fad130dcc728 | 3,698 | py | Python | allennlp/data/dataset_readers/babi.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 2 | 2021-04-27T19:56:28.000Z | 2021-08-19T05:34:37.000Z | allennlp/data/dataset_readers/babi.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 5 | 2021-05-03T14:40:33.000Z | 2021-05-03T14:40:34.000Z | allennlp/data/dataset_readers/babi.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 2 | 2019-12-21T05:58:44.000Z | 2021-08-16T07:41:21.000Z | import logging
from typing import Dict, List
from overrides import overrides
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.instance import Instance
from allennlp.data.fields import Field, TextField, ListField, IndexField
fr... | 35.219048 | 103 | 0.626555 | import logging
from typing import Dict, List
from overrides import overrides
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.instance import Instance
from allennlp.data.fields import Field, TextField, ListField, IndexField
fr... | true | true |
f707f42d22b005e6e216b1e9374ce2cbe6b88023 | 3,685 | py | Python | lib/scrapy/http/response/text.py | langzeyu/book-crawler | e2d96648384658c7775bd02d94eab086c9ece677 | [
"MIT"
] | 5 | 2019-04-02T05:00:03.000Z | 2021-04-21T11:03:50.000Z | lib/scrapy/http/response/text.py | langzeyu/book-crawler | e2d96648384658c7775bd02d94eab086c9ece677 | [
"MIT"
] | null | null | null | lib/scrapy/http/response/text.py | langzeyu/book-crawler | e2d96648384658c7775bd02d94eab086c9ece677 | [
"MIT"
] | null | null | null | """
This module implements the TextResponse class which adds encoding handling and
discovering (through HTTP headers) to base Response class.
See documentation in docs/topics/request-response.rst
"""
import re
import codecs
from scrapy.xlib.BeautifulSoup import UnicodeDammit
from scrapy.http.response import Response
... | 34.764151 | 84 | 0.646404 |
import re
import codecs
from scrapy.xlib.BeautifulSoup import UnicodeDammit
from scrapy.http.response import Response
from scrapy.utils.python import memoizemethod_noargs
from scrapy.utils.encoding import encoding_exists, resolve_encoding
from scrapy.conf import settings
# bad utf-8 encoded strings. see http://bugs.... | true | true |
f707f7ff5b358bb0c46615922c3a1238ed20d144 | 11,394 | py | Python | qlib/strategy/base.py | goodchinas/qlib | d01de411a879dc98dfa7eab4da41d52b903f466c | [
"MIT"
] | null | null | null | qlib/strategy/base.py | goodchinas/qlib | d01de411a879dc98dfa7eab4da41d52b903f466c | [
"MIT"
] | null | null | null | qlib/strategy/base.py | goodchinas/qlib | d01de411a879dc98dfa7eab4da41d52b903f466c | [
"MIT"
] | 1 | 2021-11-04T09:24:45.000Z | 2021-11-04T09:24:45.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from qlib.backtest.exchange import Exchange
from qlib.backtest.position import BasePosition
from typing import List, Tuple, Union
from ..model.base imp... | 39.289655 | 143 | 0.669124 | from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from qlib.backtest.exchange import Exchange
from qlib.backtest.position import BasePosition
from typing import List, Tuple, Union
from ..model.base import BaseModel
from ..data.dataset import DatasetH
from ..data.dataset.uti... | true | true |
f707f9f5620e2e46442586433401d453c0cdd2a0 | 26,593 | py | Python | tensorflow/python/ops/ragged/ragged_getitem_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 7 | 2022-03-04T21:14:47.000Z | 2022-03-22T23:07:39.000Z | tensorflow/python/ops/ragged/ragged_getitem_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 19 | 2021-12-28T12:44:55.000Z | 2022-01-13T08:11:28.000Z | tensorflow/python/ops/ragged/ragged_getitem_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 1 | 2021-11-21T02:32:27.000Z | 2021-11-21T02:32:27.000Z | # Copyright 2018 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... | 45.303237 | 84 | 0.63167 |
import re
from absl.testing import parameterized
from tensorflow.python.eager import context
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
from tensorflow.python.framework import test_util
from tensorflow.python.ops i... | true | true |
f707fb38fc701fe6ce1b8c40b3ffe14b403435a4 | 3,901 | py | Python | tests/test_ucuenca.py | stsewd/ucuenca.py | 1c74dbc9ec133dbcaa2967004e7fc9e4cf12feb5 | [
"MIT"
] | 3 | 2017-06-13T03:23:59.000Z | 2019-02-22T05:18:57.000Z | tests/test_ucuenca.py | stsewd/ucuenca.py | 1c74dbc9ec133dbcaa2967004e7fc9e4cf12feb5 | [
"MIT"
] | 6 | 2017-01-09T20:00:51.000Z | 2017-03-23T05:25:44.000Z | tests/test_ucuenca.py | stsewd/ucuenca.py | 1c74dbc9ec133dbcaa2967004e7fc9e4cf12feb5 | [
"MIT"
] | 2 | 2018-03-06T03:25:57.000Z | 2019-03-14T21:53:44.000Z | import unittest
import json
import os
from ucuenca.ucuenca import Ucuenca
TEST_RESOURCES = os.path.join(
os.path.dirname(__file__),
"..", "tests_resources"
)
class GetCareersTests(unittest.TestCase):
def setUp(self):
self.ucuenca = Ucuenca()
def test_careers(self):
"""Check 0104926... | 30.24031 | 77 | 0.651115 | import unittest
import json
import os
from ucuenca.ucuenca import Ucuenca
TEST_RESOURCES = os.path.join(
os.path.dirname(__file__),
"..", "tests_resources"
)
class GetCareersTests(unittest.TestCase):
def setUp(self):
self.ucuenca = Ucuenca()
def test_careers(self):
student_id = '01... | true | true |
f707fb42cf5a2edc45e9a23382387f7ca9663d6c | 577 | py | Python | oops_fhir/r4/value_set/common_ucumcodes_for_age.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/common_ucumcodes_for_age.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/common_ucumcodes_for_age.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
__all__ = ["CommonUCUMCodesForAge"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class CommonUCUMCodesForAge(ValueSet):
"""
Common UCUM Codes for Age
Unifi... | 19.233333 | 73 | 0.712305 | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
__all__ = ["CommonUCUMCodesForAge"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class CommonUCUMCodesForAge(ValueSet):
pass
class Meta:
resource ... | true | true |
f707fc86a94333cce79cba21f503b205a669be39 | 4,171 | py | Python | Incident-Response/Tools/grr/grr/core/grr_response_core/lib/parsers/__init__.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 1 | 2021-07-24T17:22:50.000Z | 2021-07-24T17:22:50.000Z | Incident-Response/Tools/grr/grr/core/grr_response_core/lib/parsers/__init__.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-28T03:40:31.000Z | 2022-02-28T03:40:52.000Z | Incident-Response/Tools/grr/grr/core/grr_response_core/lib/parsers/__init__.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-25T08:34:51.000Z | 2022-03-16T17:29:44.000Z | #!/usr/bin/env python
"""Generic parsers (for GRR server and client code)."""
from typing import Iterator
from typing import Text
from typing import Type
from typing import TypeVar
from grr_response_core.lib import factory
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.parsers import abstract
fr... | 35.649573 | 80 | 0.771997 | from typing import Iterator
from typing import Text
from typing import Type
from typing import TypeVar
from grr_response_core.lib import factory
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.parsers import abstract
from grr_response_core.lib.util import collection
from grr_response_core.lib.uti... | true | true |
f707fcc55aa082ff4a710a1c92b8613d1ec4a4b8 | 464 | py | Python | utils/message_cooldown.py | Chr1sDev/Bloo | 3e580c06c415f949997a1b6417308aa93543d64b | [
"MIT"
] | 34 | 2021-10-30T16:48:28.000Z | 2022-03-25T03:22:12.000Z | utils/message_cooldown.py | Chr1sDev/Bloo | 3e580c06c415f949997a1b6417308aa93543d64b | [
"MIT"
] | 9 | 2021-11-19T04:25:29.000Z | 2022-03-09T22:35:46.000Z | utils/message_cooldown.py | Chr1sDev/Bloo | 3e580c06c415f949997a1b6417308aa93543d64b | [
"MIT"
] | 20 | 2021-11-05T21:14:59.000Z | 2022-03-30T21:15:40.000Z | from discord.ext import commands
"""
A custom Cooldown type subclassing built in cooldowns from discord.ext commands.
This is a bucket type that allows cooldowns to work based on some text, allowing
things like cooldown on individual `Tags`, or message spam detection.
"""
class MessageTextBucket(commands.BucketType):... | 27.294118 | 80 | 0.711207 | from discord.ext import commands
class MessageTextBucket(commands.BucketType):
custom = 7
def get_key(self, text):
return text
def __call__(self, msg):
return self.get_key(msg)
| true | true |
f707fcd87d09d2e1a64f0ee2d3b03762ada6274b | 243 | py | Python | leetCode/algorithms/easy/find_greatest_common_divisor_of_array.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 25 | 2015-01-21T16:39:18.000Z | 2021-05-24T07:01:24.000Z | leetCode/algorithms/easy/find_greatest_common_divisor_of_array.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 2 | 2020-09-30T19:39:36.000Z | 2020-10-01T17:15:16.000Z | leetCode/algorithms/easy/find_greatest_common_divisor_of_array.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 15 | 2015-01-21T16:39:27.000Z | 2020-10-01T17:00:22.000Z | from typing import List
class Solution:
def findGCD(self, nums: List[int]) -> int:
a, b = min(nums), max(nums)
for i in range(a, 1, -1):
if b % i == 0 and a % i == 0:
return i
return 1
| 22.090909 | 46 | 0.477366 | from typing import List
class Solution:
def findGCD(self, nums: List[int]) -> int:
a, b = min(nums), max(nums)
for i in range(a, 1, -1):
if b % i == 0 and a % i == 0:
return i
return 1
| true | true |
f707fcf120b0aa566709b4090ad0439dfca5c5d7 | 3,940 | py | Python | cs15211/InsertintoaBinarySearchTree.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | 1 | 2021-07-05T01:53:30.000Z | 2021-07-05T01:53:30.000Z | cs15211/InsertintoaBinarySearchTree.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | null | null | null | cs15211/InsertintoaBinarySearchTree.py | JulyKikuAkita/PythonPrac | 0ba027d9b8bc7c80bc89ce2da3543ce7a49a403c | [
"Apache-2.0"
] | 1 | 2018-01-08T07:14:08.000Z | 2018-01-08T07:14:08.000Z | __source__ = 'https://leetcode.com/problems/insert-into-a-binary-search-tree/'
# Time: O(h) h: height of the tree
# Space: O(h)
#
# Description: Leetcode # 701. Insert into a Binary Search Tree
#
# Given the root node of a binary search tree (BST) and a value to be inserted into the tree,
# insert the value into the B... | 25.584416 | 93 | 0.555838 | __source__ = 'https://leetcode.com/problems/insert-into-a-binary-search-tree/'
import unittest
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def insertIntoBST(self, root, val):
if not root:
roo... | true | true |
f707fdcef8fbf5d9da0777b3f6d831fb0715ffb7 | 909 | py | Python | run.py | dipans/case-service | 65c8514c344dff895daf41298f0225837e6c3207 | [
"MIT"
] | null | null | null | run.py | dipans/case-service | 65c8514c344dff895daf41298f0225837e6c3207 | [
"MIT"
] | null | null | null | run.py | dipans/case-service | 65c8514c344dff895daf41298f0225837e6c3207 | [
"MIT"
] | null | null | null | from flask import Flask, json
import logging
def log_exception(sender, exception, **extra):
sender.logger.debug('Got exception during processing: %s', exception)
def create_app(config_file):
#Instantiating Flask and appling config
app = Flask(__name__)
app.config.from_object(config_file)
from ap... | 24.567568 | 73 | 0.645765 | from flask import Flask, json
import logging
def log_exception(sender, exception, **extra):
sender.logger.debug('Got exception during processing: %s', exception)
def create_app(config_file):
app = Flask(__name__)
app.config.from_object(config_file)
from app import api_bp
app.register_bluepri... | true | true |
f707ff9314e132e4d7436906b76792c00a7e668a | 2,245 | py | Python | examples/tf/trpo_cubecrash.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | 2 | 2021-02-07T12:14:52.000Z | 2021-07-29T08:07:22.000Z | examples/tf/trpo_cubecrash.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | null | null | null | examples/tf/trpo_cubecrash.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""This is an example to train a task with TRPO algorithm.
Here it runs CubeCrash-v0 environment with 100 iterations.
"""
import click
import gym
from metarl import wrap_experiment
from metarl.envs import MetaRLEnv, normalize
from metarl.experiment import LocalTFRunner
from metarl.experiment.de... | 35.078125 | 75 | 0.575056 | import click
import gym
from metarl import wrap_experiment
from metarl.envs import MetaRLEnv, normalize
from metarl.experiment import LocalTFRunner
from metarl.experiment.deterministic import set_seed
from metarl.tf.algos import TRPO
from metarl.tf.baselines import GaussianCNNBaseline
from metarl.tf.policies import Ca... | true | true |
f708019880f311a66cf3983cc6ca3b09d0e8303c | 4,562 | py | Python | mpld3/utils.py | fdeheeger/mpld3 | c1b7fb0e3a2b0e3fd061f976c0fd19435028e611 | [
"BSD-3-Clause"
] | 2 | 2021-08-04T08:00:34.000Z | 2021-08-04T08:00:35.000Z | mpld3/utils.py | boris-arzur/mpld3 | e28a87210f974ca0659aaafa38af9f01596daa22 | [
"BSD-3-Clause"
] | null | null | null | mpld3/utils.py | boris-arzur/mpld3 | e28a87210f974ca0659aaafa38af9f01596daa22 | [
"BSD-3-Clause"
] | 1 | 2020-06-15T12:53:39.000Z | 2020-06-15T12:53:39.000Z | """
mpld3 Utilities
===============
Utility routines for the mpld3 package
"""
import os
import re
import shutil
import warnings
from functools import wraps
from . import urls
# Make sure that DeprecationWarning gets printed
warnings.simplefilter("always", DeprecationWarning)
def html_id_ok(objid, html5=False):
... | 31.680556 | 79 | 0.612889 |
import os
import re
import shutil
import warnings
from functools import wraps
from . import urls
warnings.simplefilter("always", DeprecationWarning)
def html_id_ok(objid, html5=False):
if html5:
return not re.search('\s', objid)
else:
return bool(re.match("^[a-zA-Z][a-zA-Z0-9\-\.\:\_]*$", ob... | true | true |
f7080296db42b6afe1d58bb05fa41a87097d1b7a | 6,495 | py | Python | examples/v1alpha3/nas/darts-cnn-cifar10/model.py | ChenjunZou/katib | 6a07daae796c29d24f63375cce71b75c4eee8d9c | [
"Apache-2.0"
] | null | null | null | examples/v1alpha3/nas/darts-cnn-cifar10/model.py | ChenjunZou/katib | 6a07daae796c29d24f63375cce71b75c4eee8d9c | [
"Apache-2.0"
] | null | null | null | examples/v1alpha3/nas/darts-cnn-cifar10/model.py | ChenjunZou/katib | 6a07daae796c29d24f63375cce71b75c4eee8d9c | [
"Apache-2.0"
] | 2 | 2020-03-03T06:15:14.000Z | 2020-03-31T05:39:05.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from operations import FactorizedReduce, StdConv, MixedOp
class Cell(nn.Module):
""" Cell for search
Each edge is mixed and continuous relaxed.
"""
def __init__(self, num_nodes, c_prev_prev, c_prev, c_cur, reduction_prev, reduction_cu... | 35.686813 | 112 | 0.602771 | import torch
import torch.nn as nn
import torch.nn.functional as F
from operations import FactorizedReduce, StdConv, MixedOp
class Cell(nn.Module):
def __init__(self, num_nodes, c_prev_prev, c_prev, c_cur, reduction_prev, reduction_cur, search_space):
super(Cell, self).__init__()
self.reduction_... | true | true |
f70802eb0367315e5902b750a11bf191194df1bf | 41 | py | Python | tools/uniqprimer/uniqprimer/test.py | InternationalRiceResearchInstitute/RiceGalaxy | 35083ed17d59ae91e622613587228d3f7ae7d794 | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | tools/uniqprimer/uniqprimer/test.py | InternationalRiceResearchInstitute/RiceGalaxy | 35083ed17d59ae91e622613587228d3f7ae7d794 | [
"CC-BY-3.0"
] | null | null | null | tools/uniqprimer/uniqprimer/test.py | InternationalRiceResearchInstitute/RiceGalaxy | 35083ed17d59ae91e622613587228d3f7ae7d794 | [
"CC-BY-3.0"
] | 3 | 2020-02-12T15:22:24.000Z | 2021-08-19T10:27:39.000Z | #!/usr/bin/python
from Bio import SeqIO
| 10.25 | 21 | 0.731707 |
from Bio import SeqIO
| true | true |
f708035a79355897d18599363f3ee63ca5175dac | 6,103 | py | Python | tests/test_networkx.py | enourbakhsh/skylink | 83270f3351ff637abeb0af25786412d4dd09134a | [
"MIT"
] | null | null | null | tests/test_networkx.py | enourbakhsh/skylink | 83270f3351ff637abeb0af25786412d4dd09134a | [
"MIT"
] | null | null | null | tests/test_networkx.py | enourbakhsh/skylink | 83270f3351ff637abeb0af25786412d4dd09134a | [
"MIT"
] | null | null | null | import os
import skylink
from skylink import testing
import numpy as np
from astropy.table import Table
import FoFCatalogMatching
import pytest # noqa
# TODO: test the matching with more than two catalogs
# TODO: test N-way matching with `linking_lengths` as a dictionary
# TODO: test if we catch illegal footprints th... | 30.212871 | 106 | 0.677372 | import os
import skylink
from skylink import testing
import numpy as np
from astropy.table import Table
import FoFCatalogMatching
import pytest
graph_lib = "networkx"
ncpus_max = os.cpu_count() linking_lengths_default = 0.75 n = 2_000
def make_mockup():
def tnormal(mu=None, sigma=None, n=None, lower=-0.5, u... | true | true |
f70803ffb59c53fef789cee13dc4890da0d7e084 | 2,527 | py | Python | common_parser.py | jackalhan/tf_autoencoder_local | 57212dd64e53ac51dc0d14a9a9480905ebf537c0 | [
"Apache-2.0"
] | null | null | null | common_parser.py | jackalhan/tf_autoencoder_local | 57212dd64e53ac51dc0d14a9a9480905ebf537c0 | [
"Apache-2.0"
] | null | null | null | common_parser.py | jackalhan/tf_autoencoder_local | 57212dd64e53ac51dc0d14a9a9480905ebf537c0 | [
"Apache-2.0"
] | null | null | null | import argparse
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument(
'--model_dir', default='./text_training',
help='Output directory for model and training stats.')
parser.add_argument(
'--data_dir', default='./text_data',
help='Directory to download the... | 42.830508 | 96 | 0.647408 | import argparse
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument(
'--model_dir', default='./text_training',
help='Output directory for model and training stats.')
parser.add_argument(
'--data_dir', default='./text_data',
help='Directory to download the... | true | true |
f708049ab33a4320070c1cc6272ae9571f5d8f8f | 2,269 | py | Python | tests/dualtor/conftest.py | saravanansv/sonic-mgmt | 677fc0cb2722dba43606957fae75d1cdf852bed7 | [
"Apache-2.0"
] | null | null | null | tests/dualtor/conftest.py | saravanansv/sonic-mgmt | 677fc0cb2722dba43606957fae75d1cdf852bed7 | [
"Apache-2.0"
] | null | null | null | tests/dualtor/conftest.py | saravanansv/sonic-mgmt | 677fc0cb2722dba43606957fae75d1cdf852bed7 | [
"Apache-2.0"
] | null | null | null | import pytest
import logging
import time
from tests.common.dualtor.dual_tor_utils import get_crm_nexthop_counter # lgtm[py/unused-import]
from tests.common.helpers.assertions import pytest_assert as py_assert
from tests.common.fixtures.ptfhost_utils import change_mac_addresses, run_garp_service
CRM_POLL_INTERVAL = 1... | 35.453125 | 97 | 0.74394 | import pytest
import logging
import time
from tests.common.dualtor.dual_tor_utils import get_crm_nexthop_counter from tests.common.helpers.assertions import pytest_assert as py_assert
from tests.common.fixtures.ptfhost_utils import change_mac_addresses, run_garp_service
CRM_POLL_INTERVAL = 1
CRM_DEFAULT_POLL_INTERVA... | true | true |
f708051a44eab9b8ed607d9c993ed299aa963e52 | 351 | py | Python | fable/fable_sources/libtbx/command_line/clear_paths.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 4 | 2016-09-30T15:03:39.000Z | 2021-03-25T13:27:08.000Z | fable/fable_sources/libtbx/command_line/clear_paths.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 1 | 2018-04-18T14:41:18.000Z | 2018-04-20T19:33:52.000Z | fable/fable_sources/libtbx/command_line/clear_paths.py | hickerson/bbn | 17ef63ad1717553ab2abb50592f8de79228c8523 | [
"MIT"
] | 3 | 2016-04-19T18:20:30.000Z | 2019-04-03T14:54:29.000Z | from __future__ import division
from libtbx.clear_paths \
import remove_or_rename_files_and_directories_if_possible
import sys
def run(args):
remaining = remove_or_rename_files_and_directories_if_possible(paths=args)
for path in remaining:
"WARNING: unable to remove or rename:", path
if (__name__ == "__main... | 27 | 76 | 0.786325 | from __future__ import division
from libtbx.clear_paths \
import remove_or_rename_files_and_directories_if_possible
import sys
def run(args):
remaining = remove_or_rename_files_and_directories_if_possible(paths=args)
for path in remaining:
"WARNING: unable to remove or rename:", path
if (__name__ == "__main... | true | true |
f70807754f550c96b6d126376377ea2da89993a5 | 678 | py | Python | app/bank/urls.py | salmanAndroidDev/digify-task | f80f1707f973b92efe6fc34d0f5bcf73b41eda36 | [
"MIT"
] | null | null | null | app/bank/urls.py | salmanAndroidDev/digify-task | f80f1707f973b92efe6fc34d0f5bcf73b41eda36 | [
"MIT"
] | null | null | null | app/bank/urls.py | salmanAndroidDev/digify-task | f80f1707f973b92efe6fc34d0f5bcf73b41eda36 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('open-account/',
views.OpenAccountAPIView.as_view(),
name='open_account'),
path('delete-account/<pk>/',
views.DeleteAccountAPIView.as_view(),
name='delete_account'),
path('deposit/<pk>/',
vi... | 22.6 | 46 | 0.589971 | from django.urls import path
from . import views
urlpatterns = [
path('open-account/',
views.OpenAccountAPIView.as_view(),
name='open_account'),
path('delete-account/<pk>/',
views.DeleteAccountAPIView.as_view(),
name='delete_account'),
path('deposit/<pk>/',
vi... | true | true |
f70807b6a2ce9a852ca7b5ad360cad98c4bda063 | 6,810 | py | Python | plugins/hg4idea/testData/bin/mercurial/win32.py | dmarcotte/intellij-community | 74ed654c3f9ed99f9cc84fa227846b2c38d683c0 | [
"Apache-2.0"
] | null | null | null | plugins/hg4idea/testData/bin/mercurial/win32.py | dmarcotte/intellij-community | 74ed654c3f9ed99f9cc84fa227846b2c38d683c0 | [
"Apache-2.0"
] | null | null | null | plugins/hg4idea/testData/bin/mercurial/win32.py | dmarcotte/intellij-community | 74ed654c3f9ed99f9cc84fa227846b2c38d683c0 | [
"Apache-2.0"
] | 1 | 2019-03-14T10:35:19.000Z | 2019-03-14T10:35:19.000Z | # win32.py - utility functions that use win32 API
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""Utility functions that use win32 API.
Mark Hammond's win32all ... | 35.46875 | 79 | 0.651395 |
"""Utility functions that use win32 API.
Mark Hammond's win32all package allows better functionality on
Windows. This module overrides definitions in util.py. If not
available, import of this module will fail, and generic code will be
used.
"""
import win32api
import errno, os, sys, pywintypes, win32con, win32file,... | false | true |
f70808e06acf6eb0d1977a072b76ca3f1f62fd15 | 4,797 | py | Python | walk_though(Run this one).py | GoreNetwork/What-s-attached-to-switch-walk-though | e592b0f467b0a3d05bc1df9c5f884bde31c1c8de | [
"Apache-2.0"
] | 1 | 2018-03-28T21:13:40.000Z | 2018-03-28T21:13:40.000Z | walk_though(Run this one).py | GoreNetwork/What-s-attached-to-switch-walk-though | e592b0f467b0a3d05bc1df9c5f884bde31c1c8de | [
"Apache-2.0"
] | null | null | null | walk_though(Run this one).py | GoreNetwork/What-s-attached-to-switch-walk-though | e592b0f467b0a3d05bc1df9c5f884bde31c1c8de | [
"Apache-2.0"
] | null | null | null | #from excel_work import*
from common_functions import *
from pull import *
#from mac_and_arp_work import *
from napalm import get_network_driver
from getpass import getpass
from pprint import pprint
from name_work import *
import openpyxl
from openpyxl import Workbook
from openpyxl.compat import range
fro... | 27.411429 | 166 | 0.691057 | from common_functions import *
from pull import *
from napalm import get_network_driver
from getpass import getpass
from pprint import pprint
from name_work import *
import openpyxl
from openpyxl import Workbook
from openpyxl.compat import range
from openpyxl.utils import get_column_letter
def write_exce... | true | true |
f70809961ec15ad12717baef40cb3cd51be1420e | 18,949 | py | Python | tastypie/test.py | mthornhill/django-tastypie | a3783a584e3853513746c65c012fa2d1369b8fd3 | [
"BSD-3-Clause"
] | null | null | null | tastypie/test.py | mthornhill/django-tastypie | a3783a584e3853513746c65c012fa2d1369b8fd3 | [
"BSD-3-Clause"
] | null | null | null | tastypie/test.py | mthornhill/django-tastypie | a3783a584e3853513746c65c012fa2d1369b8fd3 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import time
from django.conf import settings
from django.test import TestCase
from django.test.client import FakePayload, Client
from django.utils.encoding import force_text
from tastypie.serializers import Serializer
try:
from urllib.parse import urlparse
except ImportErr... | 35.888258 | 150 | 0.608845 | from __future__ import unicode_literals
import time
from django.conf import settings
from django.test import TestCase
from django.test.client import FakePayload, Client
from django.utils.encoding import force_text
from tastypie.serializers import Serializer
try:
from urllib.parse import urlparse
except ImportErr... | true | true |
f7080b1b05bc9b4df0a3a79e8b0eb0dbc73a0cf1 | 78 | py | Python | fedml_core/distributed/communication/mqtt/__init__.py | Alex-Roudjiat/Federated-ML-AI-Federated-ML- | 8ccc24cf2c01b868988f5d5bd65f1666cf5526bc | [
"Apache-2.0"
] | 1,120 | 2020-07-22T02:30:52.000Z | 2022-03-31T08:10:44.000Z | fedml_core/distributed/communication/mqtt/__init__.py | Alex-Roudjiat/Federated-ML-AI-Federated-ML- | 8ccc24cf2c01b868988f5d5bd65f1666cf5526bc | [
"Apache-2.0"
] | 113 | 2020-07-27T03:48:09.000Z | 2022-03-30T03:25:56.000Z | fedml_core/distributed/communication/mqtt/__init__.py | Alex-Roudjiat/Federated-ML-AI-Federated-ML- | 8ccc24cf2c01b868988f5d5bd65f1666cf5526bc | [
"Apache-2.0"
] | 381 | 2020-07-22T06:12:57.000Z | 2022-03-30T18:38:35.000Z | __all__ = ['MqttCommManager']
from .mqtt_comm_manager import MqttCommManager
| 19.5 | 46 | 0.820513 | __all__ = ['MqttCommManager']
from .mqtt_comm_manager import MqttCommManager
| true | true |
f7080bda87962f392c237b1d02e4098153d22ac8 | 17,856 | py | Python | tests/rest/admin/test_device.py | mlakkadshaw/synapse | 74a2365bd5066955567cc551e72632d6cece94b9 | [
"Apache-2.0"
] | 9,945 | 2015-01-02T07:41:06.000Z | 2022-03-31T23:22:42.000Z | tests/rest/admin/test_device.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 9,320 | 2015-01-08T14:09:03.000Z | 2022-03-31T21:11:24.000Z | tests/rest/admin/test_device.py | t2bot/synapse | 62ca554ef09330cb88d46fca8296a859d0adc143 | [
"Apache-2.0"
] | 2,299 | 2015-01-31T22:16:29.000Z | 2022-03-31T06:08:26.000Z | # Copyright 2020 Dirk Klimpel
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 33.066667 | 114 | 0.613295 | import urllib.parse
from http import HTTPStatus
from parameterized import parameterized
from twisted.test.proto_helpers import MemoryReactor
import synapse.rest.admin
from synapse.api.errors import Codes
from synapse.rest.client import login
from synapse.server import HomeServer
from synapse.util import Clock
from ... | true | true |
f7080bfceabcc1942419df8b4bafac017707b78d | 21,935 | py | Python | pysc2/lib/features_test.py | radiantprism/StarCraft-2 | 1f159ae84feaed17c5e0bd70e272c06992ae0c48 | [
"Apache-2.0"
] | 8,095 | 2017-08-09T17:28:48.000Z | 2022-03-31T00:19:45.000Z | pysc2/lib/features_test.py | radiantprism/StarCraft-2 | 1f159ae84feaed17c5e0bd70e272c06992ae0c48 | [
"Apache-2.0"
] | 328 | 2017-08-09T20:10:20.000Z | 2022-03-29T05:04:37.000Z | pysc2/lib/features_test.py | radiantprism/StarCraft-2 | 1f159ae84feaed17c5e0bd70e272c06992ae0c48 | [
"Apache-2.0"
] | 1,391 | 2017-08-09T18:46:20.000Z | 2022-03-18T07:46:23.000Z | #!/usr/bin/python
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 36.742044 | 115 | 0.716389 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import pickle
from absl.testing import absltest
from absl.testing import parameterized
from future.builtins import range import numpy
import six
from pysc2.lib import actions
from pysc2.lib impor... | true | true |
f7080c518ae1fc47e5711644e4f224ee3c1b2c7f | 1,116 | py | Python | setup.py | timgates42/kivy-ios | 132eb2739279c479556e74575b97ba9df8faf046 | [
"MIT"
] | null | null | null | setup.py | timgates42/kivy-ios | 132eb2739279c479556e74575b97ba9df8faf046 | [
"MIT"
] | null | null | null | setup.py | timgates42/kivy-ios | 132eb2739279c479556e74575b97ba9df8faf046 | [
"MIT"
] | null | null | null | import os
from glob import glob
from setuptools import setup, find_packages
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
def recursive_include(module):
module_path = module.replace(".", "/") + "/"
files = glob(f"{module_path}**", recursive=True... | 31 | 82 | 0.671147 | import os
from glob import glob
from setuptools import setup, find_packages
def read(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as f:
return f.read()
def recursive_include(module):
module_path = module.replace(".", "/") + "/"
files = glob(f"{module_path}**", recursive=True... | true | true |
f7080d396c4f1a78d80c63ef4098a0c25063085e | 114 | py | Python | srptools/exceptions.py | idlesign/srptools | 35dd4a355e0723cdc1252eb346cff69b9073711d | [
"BSD-3-Clause"
] | 20 | 2017-02-13T15:16:18.000Z | 2022-01-27T15:49:06.000Z | srptools/exceptions.py | idlesign/srptools | 35dd4a355e0723cdc1252eb346cff69b9073711d | [
"BSD-3-Clause"
] | 10 | 2017-03-05T15:09:49.000Z | 2022-01-28T05:44:45.000Z | srptools/exceptions.py | idlesign/srptools | 35dd4a355e0723cdc1252eb346cff69b9073711d | [
"BSD-3-Clause"
] | 7 | 2017-03-11T07:50:09.000Z | 2021-12-16T11:59:00.000Z | from __future__ import unicode_literals
class SRPException(Exception):
"""Base srptools exception class."""
| 19 | 40 | 0.77193 | from __future__ import unicode_literals
class SRPException(Exception):
| true | true |
f7080e2cbbea07d976c6f91d6794ea06cc485769 | 817 | py | Python | examples/wrap_pytorch.py | ccoulombe/thinc | 8d891b61ddef3ca00266ca0ec7c47e2d063a3a83 | [
"MIT"
] | null | null | null | examples/wrap_pytorch.py | ccoulombe/thinc | 8d891b61ddef3ca00266ca0ec7c47e2d063a3a83 | [
"MIT"
] | null | null | null | examples/wrap_pytorch.py | ccoulombe/thinc | 8d891b61ddef3ca00266ca0ec7c47e2d063a3a83 | [
"MIT"
] | null | null | null | import plac
import numpy
import torch
from torch import autograd
from torch import nn
import torch.optim
import torch.cuda
from thinc.neural.ops import CupyOps
from thinc.extra.wrappers import PyTorchWrapper
from thinc.v2v import Model
def main(length=1000, nO=32, nI=32):
if CupyOps.xp != None:
print("U... | 22.081081 | 63 | 0.656059 | import plac
import numpy
import torch
from torch import autograd
from torch import nn
import torch.optim
import torch.cuda
from thinc.neural.ops import CupyOps
from thinc.extra.wrappers import PyTorchWrapper
from thinc.v2v import Model
def main(length=1000, nO=32, nI=32):
if CupyOps.xp != None:
print("U... | true | true |
f7080e67524a51871c0f56f0d55f2da7a6eaf532 | 4,542 | py | Python | app/common/views.py | vigov5/oshougatsu2015 | 38cbf325675ee2c08a6965b8689fad8308eb84eb | [
"MIT"
] | null | null | null | app/common/views.py | vigov5/oshougatsu2015 | 38cbf325675ee2c08a6965b8689fad8308eb84eb | [
"MIT"
] | null | null | null | app/common/views.py | vigov5/oshougatsu2015 | 38cbf325675ee2c08a6965b8689fad8308eb84eb | [
"MIT"
] | null | null | null | from flask import render_template, g, request, url_for, jsonify, redirect
from flask_login import current_user, login_required
import flask_menu as menu
from sqlalchemy import desc, asc
from app import app, lm
from app.user.models import User, UserJoin
from app.contest.models import Contest
from app.submission.models ... | 34.671756 | 237 | 0.6321 | from flask import render_template, g, request, url_for, jsonify, redirect
from flask_login import current_user, login_required
import flask_menu as menu
from sqlalchemy import desc, asc
from app import app, lm
from app.user.models import User, UserJoin
from app.contest.models import Contest
from app.submission.models ... | true | true |
f7080ea0135fa78c83425edc26e83fafaf4e91c6 | 2,579 | py | Python | tests/test_day_05.py | jrcoutinho/aoc-2019-python | 307ecddc0f7feeb31bc5d95a0479d5498bbf2679 | [
"MIT"
] | null | null | null | tests/test_day_05.py | jrcoutinho/aoc-2019-python | 307ecddc0f7feeb31bc5d95a0479d5498bbf2679 | [
"MIT"
] | null | null | null | tests/test_day_05.py | jrcoutinho/aoc-2019-python | 307ecddc0f7feeb31bc5d95a0479d5498bbf2679 | [
"MIT"
] | null | null | null | from aoc.day_02 import IntcodeComputer
def _run_test(program, expected):
computer = IntcodeComputer(program).execute()
assert ",".join(str(x) for x in computer.memory) == expected
def test_input(monkeypatch):
monkeypatch.setattr("builtins.input", lambda: "1")
program = "3,0,99"
expected = "1,0,... | 26.587629 | 64 | 0.666537 | from aoc.day_02 import IntcodeComputer
def _run_test(program, expected):
computer = IntcodeComputer(program).execute()
assert ",".join(str(x) for x in computer.memory) == expected
def test_input(monkeypatch):
monkeypatch.setattr("builtins.input", lambda: "1")
program = "3,0,99"
expected = "1,0,... | true | true |
f7080ea22b594eb170cc9fc284bca87deed83679 | 18,309 | py | Python | nipyapi/nifi/models/controller_status_dto.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/controller_status_dto.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | nipyapi/nifi/models/controller_status_dto.py | oneextrafact/nipyapi | 4c184d69002a8ee3ac528fda63b2ffcc6cedbae5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
NiFi Rest Api
The Rest Api provides programmatic access to command and control a NiFi instance in real time. Start and stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description, ... | 33.532967 | 479 | 0.655579 |
from pprint import pformat
from six import iteritems
import re
class ControllerStatusDTO(object):
swagger_types = {
'active_thread_count': 'int',
'terminated_thread_count': 'int',
'queued': 'str',
'flow_files_queued': 'int',
'bytes_queued': 'int',
'running_coun... | true | true |
f7080eaefa65d3a729296006984ef9636d09f1a7 | 4,838 | py | Python | repo/plugin.video.exodus/resources/lib/sources/mfree_mv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | repo/plugin.video.exodus/resources/lib/sources/mfree_mv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | repo/plugin.video.exodus/resources/lib/sources/mfree_mv.py | Hades01/Addons | 710da97ac850197498a3cd64be1811c593610add | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opti... | 34.312057 | 147 | 0.509921 |
import re,urlparse
from resources.lib.modules import cleantitle
from resources.lib.modules import client
from resources.lib.modules import cache
from resources.lib.modules import directstream
class source:
def __init__(self):
self.domains = ['m4ufree.info']
self.base_link = 'http... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.