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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c127de4c5b4f2f22925d5a1faf1900a8dc24a55 | 2,181 | py | Python | tools/util.py | RSB4760/apq8016_external_vixl | dc661669ef2e2fd18c4e21333d6a12112b520436 | [
"BSD-3-Clause"
] | null | null | null | tools/util.py | RSB4760/apq8016_external_vixl | dc661669ef2e2fd18c4e21333d6a12112b520436 | [
"BSD-3-Clause"
] | null | null | null | tools/util.py | RSB4760/apq8016_external_vixl | dc661669ef2e2fd18c4e21333d6a12112b520436 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2014, ARM Limited
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the f... | 37.603448 | 79 | 0.758368 |
import os
import sys
import subprocess
import shlex
import re
def abort(message):
print('ABORTING: ' + message)
sys.exit(1)
def getstatusoutput(command):
try:
args = shlex.split(command)
output = subprocess.check_output(args, stderr=subprocess.STDOUT)
return 0, output.rstrip('\n')
except subpro... | true | true |
1c127eef2bdc4d20758b529aafe2e483e30943c5 | 10,296 | py | Python | whd/dispatcher.py | jia-jerry/cc-utils | 01322d2acb7343c92138dcf0b6ac913b276525bc | [
"Apache-2.0"
] | null | null | null | whd/dispatcher.py | jia-jerry/cc-utils | 01322d2acb7343c92138dcf0b6ac913b276525bc | [
"Apache-2.0"
] | null | null | null | whd/dispatcher.py | jia-jerry/cc-utils | 01322d2acb7343c92138dcf0b6ac913b276525bc | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed
# under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 37.169675 | 101 | 0.625389 |
import datetime
import functools
import time
from flask import current_app as app
from model.webhook_dispatcher import WebhookDispatcherConfig
from .model import (
PushEvent,
PullRequestEvent,
PullRequestAction,
RefType,
)
from github.util import GitHubRepositoryHelper
from .pipelines import update... | true | true |
1c127f97d1bd3e22602dd247a594de642fc91e9e | 8,580 | py | Python | gui/dataset/budgetary_consistency.py | HaoZeke/prest | eec6b34bde4e060f52a391662347918995ded245 | [
"BSD-3-Clause"
] | null | null | null | gui/dataset/budgetary_consistency.py | HaoZeke/prest | eec6b34bde4e060f52a391662347918995ded245 | [
"BSD-3-Clause"
] | null | null | null | gui/dataset/budgetary_consistency.py | HaoZeke/prest | eec6b34bde4e060f52a391662347918995ded245 | [
"BSD-3-Clause"
] | null | null | null | import doc
import dataset
import util.tree_model
import uic.view_dataset
import platform_specific
from dataset import Dataset, Analysis, ExportVariant, DatasetHeaderC
from typing import Sequence, NamedTuple, List, Iterator, Tuple
from gui.progress import Worker, Cancelled
from util.codec import namedtupleC, strC, intC,... | 37.142857 | 113 | 0.578904 | import doc
import dataset
import util.tree_model
import uic.view_dataset
import platform_specific
from dataset import Dataset, Analysis, ExportVariant, DatasetHeaderC
from typing import Sequence, NamedTuple, List, Iterator, Tuple
from gui.progress import Worker, Cancelled
from util.codec import namedtupleC, strC, intC,... | true | true |
1c1280b2007e29b6e3235c19603d06d94369ca25 | 92 | py | Python | flask/run.py | Rohitkuru/applicationflask | 8137d67222e0cf72a5594ad6c3fd17bee19abe87 | [
"MIT"
] | null | null | null | flask/run.py | Rohitkuru/applicationflask | 8137d67222e0cf72a5594ad6c3fd17bee19abe87 | [
"MIT"
] | null | null | null | flask/run.py | Rohitkuru/applicationflask | 8137d67222e0cf72a5594ad6c3fd17bee19abe87 | [
"MIT"
] | null | null | null | #!/app/flask/env/bin/python3
from app import app
if __name__ == "__main__":
app.run()
| 13.142857 | 28 | 0.663043 |
from app import app
if __name__ == "__main__":
app.run()
| true | true |
1c1281002c143f11bcfa7cffb97ec1547f6f1c2d | 6,042 | py | Python | srl_core/algo/gail.py | chenzeyin9867/srl | 309fdaa2703fa9688d993c24c217edb45a6e4332 | [
"MIT"
] | 3 | 2021-11-15T06:57:46.000Z | 2022-02-17T03:22:32.000Z | srl_core/algo/gail.py | chenzeyin9867/srl | 309fdaa2703fa9688d993c24c217edb45a6e4332 | [
"MIT"
] | null | null | null | srl_core/algo/gail.py | chenzeyin9867/srl | 309fdaa2703fa9688d993c24c217edb45a6e4332 | [
"MIT"
] | null | null | null | # import h5py
# import numpy as np
# import torch
# import torch.nn as nn
# import torch.nn.functional as F
# import torch.utils.data
# from torch import autograd
#
# # from stable_baselines3.common.running_mean_std import RunningMeanStd
#
# class Discriminator(nn.Module):
# def __init__(self, input_dim,... | 36.179641 | 81 | 0.531943 | true | true | |
1c12817f681ab3ddeed8f8dcf47adf2e9a794ffc | 3,668 | py | Python | tests/func/test_live.py | mrstegeman/dvc | 03fc531a5c1f3814061e83bc26e7af5b0ff02f1d | [
"Apache-2.0"
] | null | null | null | tests/func/test_live.py | mrstegeman/dvc | 03fc531a5c1f3814061e83bc26e7af5b0ff02f1d | [
"Apache-2.0"
] | null | null | null | tests/func/test_live.py | mrstegeman/dvc | 03fc531a5c1f3814061e83bc26e7af5b0ff02f1d | [
"Apache-2.0"
] | null | null | null | from textwrap import dedent
import pytest
from dvc import stage as stage_module
from dvc.exceptions import MetricsError
LIVE_SCRITP = dedent(
"""
import dvclive
import sys
r = 2
for i in range(r):
dvclive.log("loss", 1-i/r)
dvclive.log("accuracy", i/r)
... | 28 | 79 | 0.634951 | from textwrap import dedent
import pytest
from dvc import stage as stage_module
from dvc.exceptions import MetricsError
LIVE_SCRITP = dedent(
"""
import dvclive
import sys
r = 2
for i in range(r):
dvclive.log("loss", 1-i/r)
dvclive.log("accuracy", i/r)
... | true | true |
1c128225922d6b206a5bc94c295591f55da1ff21 | 4,633 | py | Python | pytypist/lessons/lessons.py | simongarisch/pytypist | 22c94f27480654eb0fa344d2b472691c9d6bf48d | [
"MIT"
] | null | null | null | pytypist/lessons/lessons.py | simongarisch/pytypist | 22c94f27480654eb0fa344d2b472691c9d6bf48d | [
"MIT"
] | 5 | 2020-06-30T00:13:18.000Z | 2020-11-03T21:01:46.000Z | pytypist/lessons/lessons.py | simongarisch/pytypist | 22c94f27480654eb0fa344d2b472691c9d6bf48d | [
"MIT"
] | null | null | null | import functools
from collections import OrderedDict
from weakref import WeakValueDictionary
from configparser import ConfigParser
from . import util
class LessonError(Exception):
""" Base exception for this module. """
class LessonValidationFailed(LessonError):
""" Lesson failed validation. """
class Les... | 28.598765 | 73 | 0.616879 | import functools
from collections import OrderedDict
from weakref import WeakValueDictionary
from configparser import ConfigParser
from . import util
class LessonError(Exception):
class LessonValidationFailed(LessonError):
class LessonNotFound(LessonError):
class LessonNameNotUnique(LessonError):
def collect_... | true | true |
1c128233f71b2d624e620b404b27d30d99890af9 | 767 | py | Python | lesson11.py | code-mage/pythonTest | 34f2c7fe72c527b7ff8fa903ac18265d1f169c3c | [
"WTFPL"
] | null | null | null | lesson11.py | code-mage/pythonTest | 34f2c7fe72c527b7ff8fa903ac18265d1f169c3c | [
"WTFPL"
] | null | null | null | lesson11.py | code-mage/pythonTest | 34f2c7fe72c527b7ff8fa903ac18265d1f169c3c | [
"WTFPL"
] | 1 | 2021-03-17T15:35:11.000Z | 2021-03-17T15:35:11.000Z | #Sorting
#Selection Sort
# Find minimum element in list, move it to the front
# then sort the remaining list the same way
# Merge Sort
# Divide your array into two halves, sort each, then merge them
# Bubble Sort
#Create a bubble with two adjacent elements in a list - 1,2 2,3 3,4 etc.
# if they are not sorted, sor... | 31.958333 | 143 | 0.745763 | true | true | |
1c1283b4ebf3773ffbaadc76967266f68297ca0c | 38 | py | Python | nca47/agent/dns_driver/__init__.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | nca47/agent/dns_driver/__init__.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | nca47/agent/dns_driver/__init__.py | WosunOO/nca_xianshu | bbb548cb67b755a57528796d4c5a66ee68df2678 | [
"Apache-2.0"
] | null | null | null | import fake_driver
import zdns_driver
| 12.666667 | 18 | 0.894737 | import fake_driver
import zdns_driver
| true | true |
1c128452543b739959ac36de92e216fb520cd95f | 422 | py | Python | src/magic_config/loaders/env_loader.py | mogaiskii/magic_config | c638ffebf5174600ef9632f923da9a35820ade3f | [
"MIT"
] | null | null | null | src/magic_config/loaders/env_loader.py | mogaiskii/magic_config | c638ffebf5174600ef9632f923da9a35820ade3f | [
"MIT"
] | null | null | null | src/magic_config/loaders/env_loader.py | mogaiskii/magic_config | c638ffebf5174600ef9632f923da9a35820ade3f | [
"MIT"
] | null | null | null | import os
from magic_config.loader import BaseLoader
class EnvLoader(BaseLoader):
__available_options__ = ['env__key']
__loader_name__ = 'env'
def get_value(self, field_name, **kwargs):
key = self.get_key(field_name, **kwargs)
return os.environ.get(key)
def set_value(self, field_nam... | 24.823529 | 53 | 0.672986 | import os
from magic_config.loader import BaseLoader
class EnvLoader(BaseLoader):
__available_options__ = ['env__key']
__loader_name__ = 'env'
def get_value(self, field_name, **kwargs):
key = self.get_key(field_name, **kwargs)
return os.environ.get(key)
def set_value(self, field_nam... | true | true |
1c12846782d9b59fe063dec192f4b641139ea2b7 | 8,982 | py | Python | sort_of_clevr_generator.py | yanchunyu71/relational-networks-paddle | 40fcd55c00d890136f52504d8b73f76ddef6e159 | [
"BSD-3-Clause"
] | null | null | null | sort_of_clevr_generator.py | yanchunyu71/relational-networks-paddle | 40fcd55c00d890136f52504d8b73f76ddef6e159 | [
"BSD-3-Clause"
] | null | null | null | sort_of_clevr_generator.py | yanchunyu71/relational-networks-paddle | 40fcd55c00d890136f52504d8b73f76ddef6e159 | [
"BSD-3-Clause"
] | null | null | null | import cv2
import os
import numpy as np
import random
import pickle
import warnings
import argparse
parser = argparse.ArgumentParser(description='Sort-of-CLEVR dataset generator')
parser.add_argument('--seed', type=int, default=1, metavar='S',
help='random seed (default: 1)')
parser.add_argument('-... | 32.661818 | 103 | 0.520374 | import cv2
import os
import numpy as np
import random
import pickle
import warnings
import argparse
parser = argparse.ArgumentParser(description='Sort-of-CLEVR dataset generator')
parser.add_argument('--seed', type=int, default=1, metavar='S',
help='random seed (default: 1)')
parser.add_argument('-... | true | true |
1c12863ebaa858e8184045358368354c659e6a6c | 4,469 | py | Python | optuna/multi_objective/samplers/_base.py | jeffzi/optuna | 133e9d678723ad9e5183789f9271b7f96db32322 | [
"MIT"
] | 1 | 2020-12-29T07:38:45.000Z | 2020-12-29T07:38:45.000Z | optuna/multi_objective/samplers/_base.py | jeffzi/optuna | 133e9d678723ad9e5183789f9271b7f96db32322 | [
"MIT"
] | 1 | 2021-06-25T15:45:42.000Z | 2021-06-25T15:45:42.000Z | optuna/multi_objective/samplers/_base.py | jeffzi/optuna | 133e9d678723ad9e5183789f9271b7f96db32322 | [
"MIT"
] | 1 | 2020-12-25T03:27:09.000Z | 2020-12-25T03:27:09.000Z | import abc
from typing import Any
from typing import Dict
from optuna import multi_objective
from optuna._experimental import experimental
from optuna.distributions import BaseDistribution
@experimental("1.4.0")
class BaseMultiObjectiveSampler(object, metaclass=abc.ABCMeta):
"""Base class for multi-objective sam... | 36.040323 | 111 | 0.669949 | import abc
from typing import Any
from typing import Dict
from optuna import multi_objective
from optuna._experimental import experimental
from optuna.distributions import BaseDistribution
@experimental("1.4.0")
class BaseMultiObjectiveSampler(object, metaclass=abc.ABCMeta):
@abc.abstractmethod
def infer_re... | true | true |
1c1286deba1ec6bbd0b2d1da4362538498abf44d | 6,106 | py | Python | extcap/SnifferAPI/Devices.py | vlad-ermachenkov/nordic_ble_sniffer | 7d4ae931cd87a48dc2e51d17003d2953c8a55ec6 | [
"MIT"
] | null | null | null | extcap/SnifferAPI/Devices.py | vlad-ermachenkov/nordic_ble_sniffer | 7d4ae931cd87a48dc2e51d17003d2953c8a55ec6 | [
"MIT"
] | null | null | null | extcap/SnifferAPI/Devices.py | vlad-ermachenkov/nordic_ble_sniffer | 7d4ae931cd87a48dc2e51d17003d2953c8a55ec6 | [
"MIT"
] | null | null | null | # Copyright (c) 2017, Nordic Semiconductor ASA
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# noti... | 36.345238 | 107 | 0.574681 |
from . import Notifications
import logging
class DeviceList(Notifications.Notifier):
def __init__(self, *args, **kwargs):
Notifications.Notifier.__init__(self, *args, **kwargs)
logging.info("args: " + str(args))
logging.info("kwargs: " + str(kwargs))
self.devices = []
... | true | true |
1c12888e3e395b6bd66552245b8afe05f396cde0 | 345 | py | Python | vectorize/shape/shape.py | karlding/vectorize | 4af821379df041dcdb85d5549308d61544e1e0fc | [
"MIT"
] | 4 | 2017-02-09T17:34:40.000Z | 2020-05-29T16:50:02.000Z | vectorize/shape/shape.py | karlding/vectorize | 4af821379df041dcdb85d5549308d61544e1e0fc | [
"MIT"
] | null | null | null | vectorize/shape/shape.py | karlding/vectorize | 4af821379df041dcdb85d5549308d61544e1e0fc | [
"MIT"
] | 1 | 2022-01-04T16:16:21.000Z | 2022-01-04T16:16:21.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
class Shape(object):
def rasterize(self):
"""Rasterize the shape, by drawing itself on the Image context"""
raise NotImplementedError('Subclasses mus... | 31.363636 | 73 | 0.77971 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
class Shape(object):
def rasterize(self):
raise NotImplementedError('Subclasses must override rasterize()')
| true | true |
1c1288ebfc9968e6b90b8160fab5e8247c8843d7 | 12,407 | py | Python | playwright/_impl/_network.py | YQing0123/playwright-python | e05ab0732cbb330892a1cb8a79dd3292a12c2106 | [
"Apache-2.0"
] | 1 | 2021-06-18T09:18:35.000Z | 2021-06-18T09:18:35.000Z | playwright/_impl/_network.py | YQing0123/playwright-python | e05ab0732cbb330892a1cb8a79dd3292a12c2106 | [
"Apache-2.0"
] | null | null | null | playwright/_impl/_network.py | YQing0123/playwright-python | e05ab0732cbb330892a1cb8a79dd3292a12c2106 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 33.80654 | 88 | 0.626824 |
import base64
import json
import mimetypes
from pathlib import Path
from types import SimpleNamespace
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union, cast
from urllib import parse
from playwright._impl._api_structures import ResourceTiming
from playwright._impl._api_types import Error
fr... | true | true |
1c12894c0ded8bc4869e68c926eb1f22a6bf6d04 | 25,324 | py | Python | testing/run_tests.py | knopp/engine | 65af9702699cb47177c9803b157304f5d78e2182 | [
"BSD-3-Clause"
] | 4 | 2020-11-25T12:22:03.000Z | 2021-03-17T07:37:18.000Z | testing/run_tests.py | knopp/engine | 65af9702699cb47177c9803b157304f5d78e2182 | [
"BSD-3-Clause"
] | 155 | 2020-11-30T09:16:59.000Z | 2022-03-29T09:40:55.000Z | testing/run_tests.py | knopp/engine | 65af9702699cb47177c9803b157304f5d78e2182 | [
"BSD-3-Clause"
] | 22 | 2020-11-25T10:58:46.000Z | 2022-01-25T09:45:25.000Z | #!/usr/bin/env python3
#
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
A top level harness to run all unit-tests in a specific engine build.
"""
import argparse
import glob
import os
import re
import... | 39.880315 | 139 | 0.718804 |
import argparse
import glob
import os
import re
import subprocess
import sys
import time
buildroot_dir = os.path.abspath(os.path.join(os.path.realpath(__file__), '..', '..', '..'))
out_dir = os.path.join(buildroot_dir, 'out')
golden_dir = os.path.join(buildroot_dir, 'flutter', 'testing', 'resources')
fonts_dir = os.... | true | true |
1c128c55453a3cbe371d03d64edf49ea8564477b | 1,183 | py | Python | new_v1.0.py | ggrp-china/autowx | b9e173b11238a2b6977edfa4a8219241c39d4c15 | [
"MIT"
] | 1 | 2021-07-23T04:18:01.000Z | 2021-07-23T04:18:01.000Z | new_v1.0.py | ggrp-china/autowx | b9e173b11238a2b6977edfa4a8219241c39d4c15 | [
"MIT"
] | null | null | null | new_v1.0.py | ggrp-china/autowx | b9e173b11238a2b6977edfa4a8219241c39d4c15 | [
"MIT"
] | null | null | null | # -*- encoding=utf8 -*-
'''
*Created on 2020-2-6
*Author:ggrp
*Version 1.0
'''
import time
import datetime
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
def load(x,name,password):
x.find_element_by_xpath("//*[@id='username']").click()
... | 28.853659 | 70 | 0.743026 | import time
import datetime
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
def load(x,name,password):
x.find_element_by_xpath("//*[@id='username']").click()
x.find_element_by_xpath("//*[@id='username']").send_keys(name)
x.find_elem... | true | true |
1c128d3aba434f5e9256bc7011fbe095bcf47f47 | 1,093 | py | Python | backend/alembic/versions/ff2ed634a1e9_initial_vending_models.py | JakobDev/website | a8c3ab943f71fe97c3ec2e56efa4f710a6fbd4cb | [
"Apache-2.0"
] | 1 | 2022-03-30T13:05:20.000Z | 2022-03-30T13:05:20.000Z | backend/alembic/versions/ff2ed634a1e9_initial_vending_models.py | JakobDev/website | a8c3ab943f71fe97c3ec2e56efa4f710a6fbd4cb | [
"Apache-2.0"
] | 58 | 2022-03-25T10:05:39.000Z | 2022-03-31T09:11:15.000Z | backend/alembic/versions/ff2ed634a1e9_initial_vending_models.py | JakobDev/website | a8c3ab943f71fe97c3ec2e56efa4f710a6fbd4cb | [
"Apache-2.0"
] | 7 | 2022-03-25T10:51:46.000Z | 2022-03-30T08:40:23.000Z | """Initial vending models
Revision ID: ff2ed634a1e9
Revises: 7589e5e508b9
Create Date: 2022-03-30 12:58:55.002060
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ff2ed634a1e9'
down_revision = '7589e5e508b9'
branch_labels = None
depends_on = None
def upgrade(... | 29.540541 | 104 | 0.704483 | from alembic import op
import sqlalchemy as sa
revision = 'ff2ed634a1e9'
down_revision = '7589e5e508b9'
branch_labels = None
depends_on = None
def upgrade():
op.create_table('stripeexpressaccount',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('user', sa.Integer(), nullable=False),
sa... | true | true |
1c128d57360370330df4e3a60f4d65b512310374 | 985 | py | Python | tests/test_debug.py | pysnmp/pyasn1 | d52a38c74df682d0b82d771028c145e8aba23ff4 | [
"BSD-2-Clause"
] | null | null | null | tests/test_debug.py | pysnmp/pyasn1 | d52a38c74df682d0b82d771028c145e8aba23ff4 | [
"BSD-2-Clause"
] | 3 | 2021-11-16T20:28:20.000Z | 2021-11-24T20:27:24.000Z | tests/test_debug.py | pysnmp/pyasn1 | d52a38c74df682d0b82d771028c145e8aba23ff4 | [
"BSD-2-Clause"
] | null | null | null | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
from tests.base import BaseTestCase
from pyasn1 import debug
from pyas... | 22.386364 | 76 | 0.671066 | import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
from tests.base import BaseTestCase
from pyasn1 import debug
from pyasn1 import error
class DebugCaseBase(BaseTestCase):
def testKnownFlags(self):
debug.setLogger(0)
debug.setLogger(debug.Debug("all", "enc... | true | true |
1c128da5dec444aa9d0ae06ce7cbbb82875e9459 | 763 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/EGL/VERSION/EGL_1_3.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/EGL/VERSION/EGL_1_3.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/EGL/VERSION/EGL_1_3.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''OpenGL extension VERSION.EGL_1_3
This module customises the behaviour of the
OpenGL.raw.EGL.VERSION.EGL_1_3 to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/VERSION/EGL_1_3.txt
'''
from OpenGL import platform, constan... | 33.173913 | 72 | 0.778506 | from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.EGL import _types, _glgets
from OpenGL.raw.EGL.VERSION.EGL_1_3 import *
from OpenGL.raw.EGL.VERSION.EGL_1_3 import _EXTENSION_NAME
def glInitEgl13VERSION():
from OpenGL import extensions
... | true | true |
1c128da6042540c3b494296212a8bccf4ed7fa26 | 408 | py | Python | 15/7702.py | platofff/inf-ege-python | 29b209e65dd444fe91470278ee79742914392821 | [
"BSD-3-Clause"
] | 7 | 2021-06-17T11:33:41.000Z | 2022-03-26T01:45:05.000Z | 15/7702.py | platofff/inf-ege-python | 29b209e65dd444fe91470278ee79742914392821 | [
"BSD-3-Clause"
] | null | null | null | 15/7702.py | platofff/inf-ege-python | 29b209e65dd444fe91470278ee79742914392821 | [
"BSD-3-Clause"
] | 1 | 2021-07-25T14:01:19.000Z | 2021-07-25T14:01:19.000Z | #!/usr/bin/env python3
P = {2, 4, 6, 8, 10, 12}
Q = {4, 8, 12, 16}
A = {}
def get_a(x, f=False):
global A
if not f:
A = set(list(A) + [x])
return True
else:
al = list(A)
try:
al.pop(al.index(x))
except ValueError:
pass
A = set(al)
def f(x):
return (x not in P) or not ((x in Q and not get_a(x)) o... | 15.111111 | 69 | 0.551471 | P = {2, 4, 6, 8, 10, 12}
Q = {4, 8, 12, 16}
A = {}
def get_a(x, f=False):
global A
if not f:
A = set(list(A) + [x])
return True
else:
al = list(A)
try:
al.pop(al.index(x))
except ValueError:
pass
A = set(al)
def f(x):
return (x not in P) or not ((x in Q and not get_a(x)) or x not in P)
for i in... | true | true |
1c128e81f5ac9fca30df72238a24a91c69115a4e | 7,497 | py | Python | tests/rest/client/v2_alpha/test_register.py | xcesiv/synapse | 047ac0cbba25ccffb93d92b46254a58f48ddaf9c | [
"Apache-2.0"
] | 1 | 2018-10-03T05:29:39.000Z | 2018-10-03T05:29:39.000Z | tests/rest/client/v2_alpha/test_register.py | xcesiv/synapse | 047ac0cbba25ccffb93d92b46254a58f48ddaf9c | [
"Apache-2.0"
] | null | null | null | tests/rest/client/v2_alpha/test_register.py | xcesiv/synapse | 047ac0cbba25ccffb93d92b46254a58f48ddaf9c | [
"Apache-2.0"
] | null | null | null | import json
from mock import Mock
from twisted.python import failure
from twisted.test.proto_helpers import MemoryReactorClock
from synapse.api.errors import InteractiveAuthIncompleteError
from synapse.http.server import JsonResource
from synapse.rest.client.v2_alpha.register import register_servlets
from synapse.ut... | 42.355932 | 87 | 0.673069 | import json
from mock import Mock
from twisted.python import failure
from twisted.test.proto_helpers import MemoryReactorClock
from synapse.api.errors import InteractiveAuthIncompleteError
from synapse.http.server import JsonResource
from synapse.rest.client.v2_alpha.register import register_servlets
from synapse.ut... | true | true |
1c128f172caf9c4955301a54a9c08032953c1b72 | 1,551 | py | Python | shops/views_autocomplete.py | EDario333/minegocito | 5dd0869fa2510bb8152f4a117f33b2a30bb6d69c | [
"MIT"
] | null | null | null | shops/views_autocomplete.py | EDario333/minegocito | 5dd0869fa2510bb8152f4a117f33b2a30bb6d69c | [
"MIT"
] | null | null | null | shops/views_autocomplete.py | EDario333/minegocito | 5dd0869fa2510bb8152f4a117f33b2a30bb6d69c | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.http import HttpResponse, JsonResponse
from django.utils.translation import gettext as _
from users.models import Users
import json
def my_shops_autocomplete(... | 27.210526 | 99 | 0.672469 | from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.http import HttpResponse, JsonResponse
from django.utils.translation import gettext as _
from users.models import Users
import json
def my_shops_autocomplete(... | true | true |
1c128f23888027ad110689464957dfeb03694492 | 1,379 | py | Python | scripts/update_service.py | AusDTO/dto-digitalmarketplace-api | 937843c9c01a71518cf4688b4daa55bbe7df1965 | [
"MIT"
] | 6 | 2017-06-09T03:38:53.000Z | 2021-12-22T02:42:15.000Z | scripts/update_service.py | AusDTO/dto-digitalmarketplace-api | 937843c9c01a71518cf4688b4daa55bbe7df1965 | [
"MIT"
] | 47 | 2016-08-02T05:21:31.000Z | 2022-03-28T01:14:17.000Z | scripts/update_service.py | AusDTO/dto-digitalmarketplace-api | 937843c9c01a71518cf4688b4daa55bbe7df1965 | [
"MIT"
] | 7 | 2016-09-13T13:07:18.000Z | 2021-02-17T10:16:21.000Z | #!/usr/bin/env python
"""Update a service
Usage:
update_service.py <endpoint> <access_token> <service_id> <filename>
Example:
./update_service.py http://localhost:5000 myToken ~/update.json
"""
import json
import requests
import getpass
from docopt import docopt
def update(base_url, access_token, file... | 23.775862 | 75 | 0.596084 |
import json
import requests
import getpass
from docopt import docopt
def update(base_url, access_token, filename, service_id):
print(base_url)
print(access_token)
print(filename)
print(service_id)
endpoint = "{}/services/{}".format(base_url, service_id)
with open(filename) as data_file:
... | true | true |
1c128f9a43ff538029ff2e1cd03fb3feed3ebf20 | 2,174 | py | Python | syntesis/scripts/torch_ising.py | DaniloZZZ/ising_model | e9282aec1a445058b9e0fd1c8b4788390a9beb69 | [
"MIT"
] | null | null | null | syntesis/scripts/torch_ising.py | DaniloZZZ/ising_model | e9282aec1a445058b9e0fd1c8b4788390a9beb69 | [
"MIT"
] | null | null | null | syntesis/scripts/torch_ising.py | DaniloZZZ/ising_model | e9282aec1a445058b9e0fd1c8b4788390a9beb69 | [
"MIT"
] | null | null | null | import torch as T
import numpy as np
from itertools import product
from torch.functional import F
import scripts.ising as ising
def get_nn_mask(J, mu):
return np.array([
[0, J, 0]
,[J, mu, J]
,[0, J, 0]
])
def get_funny_mask(J, mu):
return np.array([
[J*2, J, J/2]
... | 25.27907 | 70 | 0.540938 | import torch as T
import numpy as np
from itertools import product
from torch.functional import F
import scripts.ising as ising
def get_nn_mask(J, mu):
return np.array([
[0, J, 0]
,[J, mu, J]
,[0, J, 0]
])
def get_funny_mask(J, mu):
return np.array([
[J*2, J, J/2]
... | true | true |
1c128ff78f15577fb04cfae6c313098089fc1267 | 1,803 | py | Python | tests/components/vaillant/test_init.py | dmaisonn/home-assistant | e40e5bf4ab5093dd30fc95ab7a68ce41d3742d9f | [
"Apache-2.0"
] | null | null | null | tests/components/vaillant/test_init.py | dmaisonn/home-assistant | e40e5bf4ab5093dd30fc95ab7a68ce41d3742d9f | [
"Apache-2.0"
] | null | null | null | tests/components/vaillant/test_init.py | dmaisonn/home-assistant | e40e5bf4ab5093dd30fc95ab7a68ce41d3742d9f | [
"Apache-2.0"
] | null | null | null | """Tests for the vaillant HUB."""
import mock
import pytest
from pymultimatic.api import ApiError
from homeassistant.components import vaillant
from homeassistant.components.vaillant import DOMAIN
from tests.components.vaillant import _setup, SystemManagerMock
@pytest.fixture(autouse=True)
def fixture_no_platform(m... | 30.559322 | 63 | 0.719911 |
import mock
import pytest
from pymultimatic.api import ApiError
from homeassistant.components import vaillant
from homeassistant.components.vaillant import DOMAIN
from tests.components.vaillant import _setup, SystemManagerMock
@pytest.fixture(autouse=True)
def fixture_no_platform(mock_system_manager):
orig_plat... | true | true |
1c129005b1c7152f20f7f112a62b5e8a1258edbd | 44,605 | py | Python | python/ccxt/kraken.py | yunexio/ccxt | 5f0343105925d7ea49781cb787da2cfbc1d4ba16 | [
"MIT"
] | null | null | null | python/ccxt/kraken.py | yunexio/ccxt | 5f0343105925d7ea49781cb787da2cfbc1d4ba16 | [
"MIT"
] | null | null | null | python/ccxt/kraken.py | yunexio/ccxt | 5f0343105925d7ea49781cb787da2cfbc1d4ba16 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
# -----------------------------------------------------------------------------
try:
basestri... | 39.719501 | 284 | 0.479677 |
from ccxt.base.exchange import Exchange
try:
basestring except NameError:
basestring = str import base64
import hashlib
import math
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors i... | true | true |
1c1290a4375306c93a45aef6f69cd1c428d1b191 | 5,261 | py | Python | payments/fields.py | wtayyeb/django-payments | 915ffd772e8e6be2f67950a45a0e3f57992d62b3 | [
"BSD-3-Clause"
] | 3 | 2020-04-17T19:01:57.000Z | 2022-03-07T19:54:43.000Z | payments/fields.py | wtayyeb/django-payments | 915ffd772e8e6be2f67950a45a0e3f57992d62b3 | [
"BSD-3-Clause"
] | 5 | 2020-03-24T16:37:25.000Z | 2021-06-10T21:24:54.000Z | payments/fields.py | wtayyeb/django-payments | 915ffd772e8e6be2f67950a45a0e3f57992d62b3 | [
"BSD-3-Clause"
] | 1 | 2021-09-13T08:54:00.000Z | 2021-09-13T08:54:00.000Z | from __future__ import unicode_literals
from calendar import monthrange
from datetime import date
import re
from django import forms
from django.core import validators
from django.utils.translation import ugettext_lazy as _
from .core import get_credit_card_issuer
from .utils import get_month_choices, get_year_choice... | 37.578571 | 76 | 0.611861 | from __future__ import unicode_literals
from calendar import monthrange
from datetime import date
import re
from django import forms
from django.core import validators
from django.utils.translation import ugettext_lazy as _
from .core import get_credit_card_issuer
from .utils import get_month_choices, get_year_choice... | true | true |
1c129219721312be6681b1013749daa8747f2469 | 2,203 | py | Python | throttled/storage/memory.py | thiagomini/ThrottledAPI | 434d495e4d76482b738a6dde3e05bdad0d9ab9cd | [
"MIT"
] | null | null | null | throttled/storage/memory.py | thiagomini/ThrottledAPI | 434d495e4d76482b738a6dde3e05bdad0d9ab9cd | [
"MIT"
] | null | null | null | throttled/storage/memory.py | thiagomini/ThrottledAPI | 434d495e4d76482b738a6dde3e05bdad0d9ab9cd | [
"MIT"
] | null | null | null | """
This module defines in-memory storage for WindowManager's
"""
import time
from typing import MutableMapping, Optional
from throttled.models import Hit, Rate
from throttled.storage import BaseStorage
from throttled.storage._abstract import _HitsWindow, _WindowManager
from throttled.storage._duration import DUR_RE... | 27.197531 | 72 | 0.649569 |
import time
from typing import MutableMapping, Optional
from throttled.models import Hit, Rate
from throttled.storage import BaseStorage
from throttled.storage._abstract import _HitsWindow, _WindowManager
from throttled.storage._duration import DUR_REGISTRY, DurationCalcType
from throttled.strategies import Strategi... | true | true |
1c12934d89feac2d6933d900384ef2fa06ea8284 | 3,443 | py | Python | .tox/scenario/lib/python2.7/site-packages/oslo_messaging/_drivers/zmq_driver/matchmaker/matchmaker_redis.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | .tox/scenario/lib/python2.7/site-packages/oslo_messaging/_drivers/zmq_driver/matchmaker/matchmaker_redis.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | .tox/scenario/lib/python2.7/site-packages/oslo_messaging/_drivers/zmq_driver/matchmaker/matchmaker_redis.py | bdrich/neutron-lbaas | b4711abfe0207c4fdd5d7fb7ecbf017e753abbfd | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 34.777778 | 78 | 0.656404 |
import logging
from oslo_config import cfg
from oslo_utils import importutils
from oslo_messaging._drivers.zmq_driver.matchmaker import base
from oslo_messaging._drivers.zmq_driver import zmq_address
redis = importutils.try_import('redis')
LOG = logging.getLogger(__name__)
matchmaker_redis_opts = [
cfg.StrOpt... | true | true |
1c1293d2c411b51b563ac3965284a48725ed3278 | 7,041 | py | Python | tensorflow/contrib/autograph/converters/side_effect_guards.py | zhangyujing/tensorflow | c7a04561fb8972fb64907acc5f10f3c6d4cef9f2 | [
"Apache-2.0"
] | 6 | 2017-08-07T14:05:41.000Z | 2020-02-28T03:57:56.000Z | tensorflow/contrib/autograph/converters/side_effect_guards.py | zhangyujing/tensorflow | c7a04561fb8972fb64907acc5f10f3c6d4cef9f2 | [
"Apache-2.0"
] | 6 | 2020-04-21T20:38:18.000Z | 2020-06-16T01:00:15.000Z | tensorflow/contrib/autograph/converters/side_effect_guards.py | zhangyujing/tensorflow | c7a04561fb8972fb64907acc5f10f3c6d4cef9f2 | [
"Apache-2.0"
] | 3 | 2018-04-11T03:08:18.000Z | 2021-05-09T21:51:42.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.863874 | 80 | 0.674904 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gast
from tensorflow.contrib.autograph.pyct import anno
from tensorflow.contrib.autograph.pyct import ast_util
from tensorflow.contrib.autograph.pyct import qual_names
from tensorflow.contrib.autograph... | true | true |
1c129513ac5d2db95072dc862ebc564ed3e93baf | 18,734 | py | Python | intersight/models/hyperflex_cluster_storage_policy.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/hyperflex_cluster_storage_policy.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/hyperflex_cluster_storage_policy.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class HyperflexClusterStoragePolicy(object):
"""
NO... | 32.637631 | 425 | 0.646578 |
from pprint import pformat
from six import iteritems
import re
class HyperflexClusterStoragePolicy(object):
swagger_types = {
'account_moid': 'str',
'ancestors': 'list[MoBaseMoRef]',
'create_time': 'datetime',
'mod_time': 'datetime',
'moid': 'str',
'object_type... | true | true |
1c129627460d8b763cb4bb22f8755d0b0cf8298a | 3,197 | py | Python | greenberry/utils.py | chrigkou/greenBerry | 5df6de65543f79a222453c168e6cb9f5b71fd523 | [
"Apache-2.0"
] | null | null | null | greenberry/utils.py | chrigkou/greenBerry | 5df6de65543f79a222453c168e6cb9f5b71fd523 | [
"Apache-2.0"
] | null | null | null | greenberry/utils.py | chrigkou/greenBerry | 5df6de65543f79a222453c168e6cb9f5b71fd523 | [
"Apache-2.0"
] | null | null | null | import contextlib
from io import StringIO
from greenBerry import greenBerry_eval
def eval(str):
"""
Function to evaluate postfix expression
"""
exp = list(str)
S = []
i = 0
while i < len(exp):
if exp[i].isnumeric():
S.append(exp[i])
else:
y = int(S[... | 29.601852 | 106 | 0.391617 | import contextlib
from io import StringIO
from greenBerry import greenBerry_eval
def eval(str):
exp = list(str)
S = []
i = 0
while i < len(exp):
if exp[i].isnumeric():
S.append(exp[i])
else:
y = int(S[-1])
S.pop()
x = int(S[-1])
... | true | true |
1c1296ecf1d7a8449a4e5adeeed617a4608cdaab | 3,056 | bzl | Python | antlir/bzl/image_layer_from_package.bzl | SaurabhAgarwala/antlir | d9513d35d3eaa9d28717a40057a14d099c6ec775 | [
"MIT"
] | null | null | null | antlir/bzl/image_layer_from_package.bzl | SaurabhAgarwala/antlir | d9513d35d3eaa9d28717a40057a14d099c6ec775 | [
"MIT"
] | null | null | null | antlir/bzl/image_layer_from_package.bzl | SaurabhAgarwala/antlir | d9513d35d3eaa9d28717a40057a14d099c6ec775 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load(":compile_image_features.bzl", "compile_image_features")
load(":constants.bzl", "REPO_CFG")
load(":flavor_helpers.bzl", "flavor_helpers")... | 40.210526 | 113 | 0.635471 |
load(":compile_image_features.bzl", "compile_image_features")
load(":constants.bzl", "REPO_CFG")
load(":flavor_helpers.bzl", "flavor_helpers")
load(":image_layer_utils.bzl", "image_layer_utils")
load(":image_utils.bzl", "image_utils")
load(":target_tagger.bzl", "image_source_as_target_tagged_dict", "new_target_tagger"... | true | true |
1c1297ba210a220b8479c345496f1fec67e8be65 | 1,963 | py | Python | tests/tests_async.py | suriya/Zappa | 9ff3e1816a662cc33a1168463e9f52777bd776b0 | [
"MIT"
] | null | null | null | tests/tests_async.py | suriya/Zappa | 9ff3e1816a662cc33a1168463e9f52777bd776b0 | [
"MIT"
] | 1 | 2021-03-25T23:39:25.000Z | 2021-03-25T23:39:25.000Z | tests/tests_async.py | DomainGroupOSS/Zappa | 5a1f8e98141aef84e64e72e938d86f03454e0f70 | [
"MIT"
] | 1 | 2017-07-22T20:04:04.000Z | 2017-07-22T20:04:04.000Z | # -*- coding: utf8 -*-
import boto3
import mock
import os
import unittest
from zappa.async import AsyncException, LambdaAsyncResponse, SnsAsyncResponse
from zappa.async import import_and_get_task, \
get_func_task_path
class TestZappa(unittest.TestCase):
def setUp(self):
self.slee... | 33.271186 | 108 | 0.664289 | import boto3
import mock
import os
import unittest
from zappa.async import AsyncException, LambdaAsyncResponse, SnsAsyncResponse
from zappa.async import import_and_get_task, \
get_func_task_path
class TestZappa(unittest.TestCase):
def setUp(self):
self.sleep_patch = mock.patch('t... | false | true |
1c12989d2048006eed549173189661a272e2e4f2 | 11,111 | py | Python | venv/lib/python3.8/site-packages/ansible_collections/community/general/plugins/modules/system/listen_ports_facts.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | 1 | 2022-02-24T18:15:56.000Z | 2022-02-24T18:15:56.000Z | venv/lib/python3.8/site-packages/ansible_collections/community/general/plugins/modules/system/listen_ports_facts.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/ansible_collections/community/general/plugins/modules/system/listen_ports_facts.py | saeedya/docker-ansible | 6fb0cfc6bc4a5925b21380952a5a4502ec02119a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, Nathan Davison <ndavison85@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
module:... | 31.655271 | 141 | 0.542705 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
module: listen_ports_facts
author:
- Nathan Davison (@ndavison)
description:
- Gather facts on processes listening on TCP and UDP ports using the C(netstat) or C(ss) commands.
- This module cur... | true | true |
1c12989d52a2550279efb98babb22dfaf62075ae | 262 | py | Python | d435_camera/__init__.py | riven314/capstone_dash_interface | 5eab25f4c15ad09aa889554820231175b0a3ed28 | [
"CC0-1.0"
] | 1 | 2019-12-10T14:59:12.000Z | 2019-12-10T14:59:12.000Z | d435_camera/__init__.py | riven314/capstone_dash_interface | 5eab25f4c15ad09aa889554820231175b0a3ed28 | [
"CC0-1.0"
] | null | null | null | d435_camera/__init__.py | riven314/capstone_dash_interface | 5eab25f4c15ad09aa889554820231175b0a3ed28 | [
"CC0-1.0"
] | 1 | 2020-01-01T12:24:51.000Z | 2020-01-01T12:24:51.000Z | import os
import sys
crt_dir = os.getcwd()
this_dir = os.path.join(crt_dir, 'd435_camera')
# when this folder serve as a module
if os.path.isdir(this_dir):
sys.path.append(this_dir)
print('d435_module added to python path: {}'.format(this_dir)) | 29.111111 | 66 | 0.706107 | import os
import sys
crt_dir = os.getcwd()
this_dir = os.path.join(crt_dir, 'd435_camera')
if os.path.isdir(this_dir):
sys.path.append(this_dir)
print('d435_module added to python path: {}'.format(this_dir)) | true | true |
1c12993b29dfa43729c5c513a4b5f9611dbb6efc | 2,824 | py | Python | locations/spiders/petco.py | bealbrown/allhours | f750ee7644246a97bd16879f14115d7845f76b89 | [
"MIT"
] | null | null | null | locations/spiders/petco.py | bealbrown/allhours | f750ee7644246a97bd16879f14115d7845f76b89 | [
"MIT"
] | null | null | null | locations/spiders/petco.py | bealbrown/allhours | f750ee7644246a97bd16879f14115d7845f76b89 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
import json
from locations.hourstudy import inputoutput
class PetcoSpider(scrapy.Spider):
name = "petco"
allowed_domains = ["stores.petco.com"]
start_urls = (
'https://stores.petco.com/',
)
def store_hours(self, store_hours):
store_hours = st... | 34.024096 | 101 | 0.566218 | import scrapy
import json
from locations.hourstudy import inputoutput
class PetcoSpider(scrapy.Spider):
name = "petco"
allowed_domains = ["stores.petco.com"]
start_urls = (
'https://stores.petco.com/',
)
def store_hours(self, store_hours):
store_hours = store_hours.strip()
... | true | true |
1c129a5ab7bb4a0281ef1b2d9c1ee4d1b6c262d5 | 3,248 | py | Python | conanfile.py | sourcedelica/conan-odbc | 0405ab1fa01d6da417d93fd9c3264a2400a01e23 | [
"MIT"
] | null | null | null | conanfile.py | sourcedelica/conan-odbc | 0405ab1fa01d6da417d93fd9c3264a2400a01e23 | [
"MIT"
] | null | null | null | conanfile.py | sourcedelica/conan-odbc | 0405ab1fa01d6da417d93fd9c3264a2400a01e23 | [
"MIT"
] | null | null | null | import os
from conans import ConanFile, AutoToolsBuildEnvironment, tools
class OdbcConan(ConanFile):
name = 'odbc'
version = '2.3.5'
description = 'Package providing unixODBC or Microsoft ODBC'
url = 'https://github.com/bincrafters/conan-odbc'
license = 'LGPL/GPL'
exports = ['LICENSE.md']
... | 42.736842 | 111 | 0.614532 | import os
from conans import ConanFile, AutoToolsBuildEnvironment, tools
class OdbcConan(ConanFile):
name = 'odbc'
version = '2.3.5'
description = 'Package providing unixODBC or Microsoft ODBC'
url = 'https://github.com/bincrafters/conan-odbc'
license = 'LGPL/GPL'
exports = ['LICENSE.md']
... | true | true |
1c129b5ae1adf19b33df091f4aa8f04a640f4a2a | 209 | py | Python | phonebook/urls.py | hosseinmoghimi/instamarket | 6f2f557843ff3105c6ca62a8b85311f0de79a2fe | [
"MIT"
] | 3 | 2020-08-14T20:17:57.000Z | 2020-09-15T19:35:40.000Z | phonebook/urls.py | hosseinmoghimi/instamarket | 6f2f557843ff3105c6ca62a8b85311f0de79a2fe | [
"MIT"
] | 5 | 2020-08-16T21:47:12.000Z | 2020-08-17T03:18:10.000Z | phonebook/urls.py | hosseinmoghimi/instamarket | 6f2f557843ff3105c6ca62a8b85311f0de79a2fe | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name='phonebook'
urlpatterns = [
path('',views.IndexView().home,name='home'),
path('entry/<int:entry_id>/',views.IndexView().entry,name='entry'),
]
| 26.125 | 71 | 0.69378 | from django.urls import path
from . import views
app_name='phonebook'
urlpatterns = [
path('',views.IndexView().home,name='home'),
path('entry/<int:entry_id>/',views.IndexView().entry,name='entry'),
]
| true | true |
1c129b923830e2bac952755c4a8385a3a99af509 | 15,961 | py | Python | pydantic/errors.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 6 | 2021-08-11T11:37:59.000Z | 2021-11-12T01:33:11.000Z | pydantic/errors.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 131 | 2020-09-21T06:17:59.000Z | 2022-03-28T08:03:46.000Z | pydantic/errors.py | jasujm/pydantic | cc1cb4826c74ac5b651ef2d80c3478428a9950ca | [
"MIT"
] | 2 | 2021-11-23T16:28:21.000Z | 2021-11-23T16:28:33.000Z | from decimal import Decimal
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Set, Tuple, Type, Union
from .typing import display_as_type
if TYPE_CHECKING:
from .typing import DictStrAny
# explicitly state exports to avoid "from .errors import *" also importing Decimal, Path etc.
__all__ ... | 26.780201 | 120 | 0.723451 | from decimal import Decimal
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Set, Tuple, Type, Union
from .typing import display_as_type
if TYPE_CHECKING:
from .typing import DictStrAny
__all__ = (
'PydanticTypeError',
'PydanticValueError',
'ConfigError',
'MissingError',
... | true | true |
1c129bc987256276c3a8515d3289f806c4658624 | 278 | py | Python | networking/conf.py | richidubey/rtems-docs | 4476290486ae0258589adbe812de69a024403cbf | [
"BSD-2-Clause"
] | 1 | 2019-08-05T18:06:10.000Z | 2019-08-05T18:06:10.000Z | networking/conf.py | richidubey/rtems-docs | 4476290486ae0258589adbe812de69a024403cbf | [
"BSD-2-Clause"
] | null | null | null | networking/conf.py | richidubey/rtems-docs | 4476290486ae0258589adbe812de69a024403cbf | [
"BSD-2-Clause"
] | null | null | null | import sys, os
sys.path.insert(0, os.path.abspath('../common/'))
from conf import *
project = "RTEMS Networking User Manual"
latex_documents = [
('index',
'networking.tex',
u'RTEMS Networking User Manual',
u'RTEMS Documentation Project',
'manual'),
]
| 18.533333 | 49 | 0.651079 | import sys, os
sys.path.insert(0, os.path.abspath('../common/'))
from conf import *
project = "RTEMS Networking User Manual"
latex_documents = [
('index',
'networking.tex',
u'RTEMS Networking User Manual',
u'RTEMS Documentation Project',
'manual'),
]
| true | true |
1c129d44330df7ceebcc27a9858ecac2afc19a31 | 1,350 | py | Python | Curso Python/Mundo 1/Modulo2/Desafios/Desafios 2/des009 - Cor.py | catabimbas/Curso-Python | 72549952db77fa9b0ea3746b83f94592e3fdeb30 | [
"MIT"
] | null | null | null | Curso Python/Mundo 1/Modulo2/Desafios/Desafios 2/des009 - Cor.py | catabimbas/Curso-Python | 72549952db77fa9b0ea3746b83f94592e3fdeb30 | [
"MIT"
] | null | null | null | Curso Python/Mundo 1/Modulo2/Desafios/Desafios 2/des009 - Cor.py | catabimbas/Curso-Python | 72549952db77fa9b0ea3746b83f94592e3fdeb30 | [
"MIT"
] | null | null | null | # Variável int
num = int(input('Digite um valor: '))
# Tabuada
x1 = num * 1
x2 = num * 2
x3 = num * 3
x4 = num * 4
x5 = num * 5
x6 = num * 6
x7 = num * 7
x8 = num * 8
x9 = num * 9
x10 = num * 10
# Cores
cor = {'fim': '\033[m',
'branco': '\033[30m'}
print("""
{}{}{} x 0 = 0
{}{}{} x 1 = {}{}{}
{}{}{} x 2 = {}{}{}... | 21.774194 | 39 | 0.416296 | num = int(input('Digite um valor: '))
x1 = num * 1
x2 = num * 2
x3 = num * 3
x4 = num * 4
x5 = num * 5
x6 = num * 6
x7 = num * 7
x8 = num * 8
x9 = num * 9
x10 = num * 10
cor = {'fim': '\033[m',
'branco': '\033[30m'}
print("""
{}{}{} x 0 = 0
{}{}{} x 1 = {}{}{}
{}{}{} x 2 = {}{}{}
{}{}{} x 3 = {}{}{}
{}{}{} x 4 =... | true | true |
1c129f2f5657f90450ad5043e472bea7ad7b0cb2 | 1,467 | py | Python | aoc_2018/day_3/python/day3_puzzle2.py | girip11/advent_of_code | b58f9a53d219bb3bef284af6b0ca59d2addd57bb | [
"MIT"
] | null | null | null | aoc_2018/day_3/python/day3_puzzle2.py | girip11/advent_of_code | b58f9a53d219bb3bef284af6b0ca59d2addd57bb | [
"MIT"
] | 1 | 2021-09-29T04:20:48.000Z | 2021-09-29T04:20:48.000Z | aoc_2018/day_3/python/day3_puzzle2.py | girip11/advent_of_code | b58f9a53d219bb3bef284af6b0ca59d2addd57bb | [
"MIT"
] | null | null | null | import sys
from typing import List, Optional, Tuple
from aoc_2018.day_3.python.day3_puzzle1 import (
Claim,
get_fabric,
get_fabric_dimensions_from_claims,
mark_fabric_with_claims,
parse_claim,
)
def main(*_: str) -> None:
claims: List[Claim] = list(map(parse_claim, sys.stdin))
print(f"Non... | 31.212766 | 97 | 0.691888 | import sys
from typing import List, Optional, Tuple
from aoc_2018.day_3.python.day3_puzzle1 import (
Claim,
get_fabric,
get_fabric_dimensions_from_claims,
mark_fabric_with_claims,
parse_claim,
)
def main(*_: str) -> None:
claims: List[Claim] = list(map(parse_claim, sys.stdin))
print(f"Non... | true | true |
1c129f8f86b311d0515ad97457e1e92c022c24e9 | 3,580 | py | Python | tests/selenium/guiops/tests/autoscaling.py | dmitrii/eucaconsole | 6de222023adbdd9c643a39eeeeed10680a3fb1fa | [
"BSD-2-Clause"
] | null | null | null | tests/selenium/guiops/tests/autoscaling.py | dmitrii/eucaconsole | 6de222023adbdd9c643a39eeeeed10680a3fb1fa | [
"BSD-2-Clause"
] | 10 | 2018-03-28T17:25:16.000Z | 2021-03-05T10:15:06.000Z | tests/selenium/guiops/tests/autoscaling.py | dmitrii/eucaconsole | 6de222023adbdd9c643a39eeeeed10680a3fb1fa | [
"BSD-2-Clause"
] | 1 | 2019-06-07T20:43:45.000Z | 2019-06-07T20:43:45.000Z | import logging
from guiops.guiops import GuiOps
from option_parser import Option_parser
class AutoScalingOperationsSequence(GuiOps):
def __init__(self):
parser = Option_parser()
self.console_url = parser.parse_options()['console_url']
self.webdriver_url = parser.parse_options()['web_drive... | 57.741935 | 116 | 0.725698 | import logging
from guiops.guiops import GuiOps
from option_parser import Option_parser
class AutoScalingOperationsSequence(GuiOps):
def __init__(self):
parser = Option_parser()
self.console_url = parser.parse_options()['console_url']
self.webdriver_url = parser.parse_options()['web_drive... | true | true |
1c129f971b37897fc894662c094d60ccabb09c7f | 8,653 | py | Python | demo_apps/funcx/run.py | AymenFJA/colmena | e764c59e62eeab31d12ee555a94a03f10e43ca07 | [
"Apache-2.0"
] | null | null | null | demo_apps/funcx/run.py | AymenFJA/colmena | e764c59e62eeab31d12ee555a94a03f10e43ca07 | [
"Apache-2.0"
] | null | null | null | demo_apps/funcx/run.py | AymenFJA/colmena | e764c59e62eeab31d12ee555a94a03f10e43ca07 | [
"Apache-2.0"
] | null | null | null | """Perform GPR Active Learning where Bayesian optimization is used to select a new
calculation as soon as one calculation completes"""
from funcx import FuncXClient
from colmena.task_server.funcx import FuncXTaskServer
from colmena.thinker import BaseThinker, agent
from colmena.redis.queue import ClientQueues, make_que... | 41.204762 | 238 | 0.644285 | from funcx import FuncXClient
from colmena.task_server.funcx import FuncXTaskServer
from colmena.thinker import BaseThinker, agent
from colmena.redis.queue import ClientQueues, make_queue_pairs
from sklearn.gaussian_process import GaussianProcessRegressor, kernels
from sklearn.preprocessing import MinMaxScaler
from skl... | true | true |
1c12a2c95682d1ff94a4a29e2c6da70189b064eb | 1,947 | py | Python | desktop/libs/hadoop/src/hadoop/ssl_client_site.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 3 | 2018-01-29T14:16:02.000Z | 2019-02-05T21:33:05.000Z | desktop/libs/hadoop/src/hadoop/ssl_client_site.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 4 | 2021-03-11T04:02:00.000Z | 2022-03-27T08:31:56.000Z | desktop/libs/hadoop/src/hadoop/ssl_client_site.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2 | 2019-12-05T17:24:36.000Z | 2021-11-22T21:21:32.000Z | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 28.632353 | 108 | 0.724191 |
import errno
import logging
import os.path
import conf
import confparse
_SSL_SITE_PATH = None _SSL_SITE_DICT = None
_CNF_TRUSTORE_LOCATION = 'ssl.client.truststore.location'
LOG = logging.getLogger(__name__)
def reset():
global _SSL_SITE_DICT
_SSL_SITE_DICT = None
def get... | false | true |
1c12a4310636a76ff515f96160ee4f8aa04ad4b5 | 2,409 | py | Python | discovery-provider/tests/test_track_tag_mat_view.py | atticwip/audius-protocol | 9758e849fae01508fa1d27675741228b11533e6e | [
"Apache-2.0"
] | 429 | 2019-08-14T01:34:07.000Z | 2022-03-30T06:31:38.000Z | discovery-provider/tests/test_track_tag_mat_view.py | SNOmad1/audius-protocol | 3d5fc2bf688265eb529060f1f3234ef2b95ed231 | [
"Apache-2.0"
] | 998 | 2019-08-14T01:52:37.000Z | 2022-03-31T23:17:22.000Z | discovery-provider/tests/test_track_tag_mat_view.py | SNOmad1/audius-protocol | 3d5fc2bf688265eb529060f1f3234ef2b95ed231 | [
"Apache-2.0"
] | 73 | 2019-10-04T04:24:16.000Z | 2022-03-24T16:27:30.000Z | from sqlalchemy import asc
from src.models import TagTrackUserMatview
from src.utils.db_session import get_db
from tests.utils import populate_mock_db
def test_track_tag_mat_view(app):
"""Tests that genre metrics can be queried"""
with app.app_context():
db = get_db()
test_entities = {
"... | 34.913043 | 86 | 0.586135 | from sqlalchemy import asc
from src.models import TagTrackUserMatview
from src.utils.db_session import get_db
from tests.utils import populate_mock_db
def test_track_tag_mat_view(app):
with app.app_context():
db = get_db()
test_entities = {
"tracks": [
{"track_id": 1, "tags": "",... | true | true |
1c12a532c6f34fb100a9041908cf405c2c6c4eee | 205 | py | Python | Chapter 5/5-13.py | Nolazco1/pythonProjects | 33938487cb2e4771ea4ff6716703868844d04e52 | [
"MIT"
] | null | null | null | Chapter 5/5-13.py | Nolazco1/pythonProjects | 33938487cb2e4771ea4ff6716703868844d04e52 | [
"MIT"
] | null | null | null | Chapter 5/5-13.py | Nolazco1/pythonProjects | 33938487cb2e4771ea4ff6716703868844d04e52 | [
"MIT"
] | null | null | null | # Create a global variable.
my_value = 10
# The show_value function prints
# the value of the global variable.
def show_value():
print(my_value)
# Call the show_value function
show_value()
| 18.636364 | 36 | 0.712195 | my_value = 10
def show_value():
print(my_value)
show_value()
| true | true |
1c12a5eff45993fa5221d800ff14f0c71f10fed2 | 2,033 | py | Python | src/ganon/gnn.py | pirovc/ganon | 2154627e230a650009a99713e5ab3f3272247515 | [
"MIT",
"BSD-3-Clause"
] | 50 | 2018-09-01T19:11:37.000Z | 2022-02-02T07:49:10.000Z | src/ganon/gnn.py | benvenutti/ganon | 0d6f1b73eacb7659a0d541567b9aa60287e05f82 | [
"MIT",
"BSD-3-Clause"
] | 123 | 2018-09-17T06:51:31.000Z | 2022-03-23T14:12:42.000Z | src/ganon/gnn.py | benvenutti/ganon | 0d6f1b73eacb7659a0d541567b9aa60287e05f82 | [
"MIT",
"BSD-3-Clause"
] | 10 | 2018-09-15T10:50:01.000Z | 2022-02-03T18:34:07.000Z | #!/usr/bin/env python3
import pickle, gzip
class Gnn:
def __init__(self,
kmer_size: int = None,
hash_functions: int = None,
number_of_bins: int = None,
bin_length: int = None,
fragment_length: int = None,
overlap_leng... | 36.303571 | 75 | 0.563207 | import pickle, gzip
class Gnn:
def __init__(self,
kmer_size: int = None,
hash_functions: int = None,
number_of_bins: int = None,
bin_length: int = None,
fragment_length: int = None,
overlap_length: int = None,
... | true | true |
1c12a6d6d57833104344e0cfa544c5cee39e3f8f | 2,281 | py | Python | tools/project-creator/Python2.6.6/Lib/Django/Isapi.py | gohopo/nineck.ca | 9601f5ae4c20f8a3ea27b06551556fa5e1eecce3 | [
"MIT"
] | 81 | 2017-03-13T08:24:01.000Z | 2021-04-02T09:48:38.000Z | tools/project-creator/Python2.6.6/Lib/Django/Isapi.py | gohopo/nineck.ca | 9601f5ae4c20f8a3ea27b06551556fa5e1eecce3 | [
"MIT"
] | 6 | 2017-04-30T08:36:55.000Z | 2017-09-22T01:37:28.000Z | tools/project-creator/Python2.6.6/Lib/Django/Isapi.py | gohopo/nineck.ca | 9601f5ae4c20f8a3ea27b06551556fa5e1eecce3 | [
"MIT"
] | 41 | 2017-03-18T14:11:58.000Z | 2021-04-14T05:06:09.000Z | # $URL: https://pyisapie.svn.sourceforge.net/svnroot/pyisapie/Tags/1.1.0-rc4/PyISAPIe/Python/Examples/Django/Isapi.py $
# $Rev: 162 $ $Date: 2009-05-28 13:37:33 -0700 (Thu, 28 May 2009) $
# (C)2008 Phillip Sitbon <phillip@sitbon.net>
#
"""Global ISAPI request handler.
This serves up the Django site 'mysite' via ... | 35.092308 | 120 | 0.707584 | from django.core.handlers.wsgi import WSGIHandler as DjangoHandler
from Http.WSGI import RunWSGI
from Http import Env
import os
os.environ["DJANGO_SETTINGS_MODULE"] = "WWW.mysite.settings"
Base = "/"
# default of "/media" assumes that you've mapped a virtual
# files to be served by the static file handler.... | true | true |
1c12a8d7bd11c46cae52b75b28e64bdba08be61c | 3,581 | py | Python | processing.py | uuefi/speech-to-text-benchmark | 214f0dedad888730944676be2f2876e8c48efed5 | [
"Apache-2.0"
] | null | null | null | processing.py | uuefi/speech-to-text-benchmark | 214f0dedad888730944676be2f2876e8c48efed5 | [
"Apache-2.0"
] | null | null | null | processing.py | uuefi/speech-to-text-benchmark | 214f0dedad888730944676be2f2876e8c48efed5 | [
"Apache-2.0"
] | null | null | null | import os
import wave
from warnings import warn
from pydub import AudioSegment
from pydub.utils import mediainfo
import librosa
import numpy as np
import scipy
import soundfile as sf
# helper to figure out the issue
def frame_rate_channel(audio_file_name, head):
#x, _ = librosa.load(audio_file_name, sr=16000)
... | 36.540816 | 118 | 0.684166 | import os
import wave
from warnings import warn
from pydub import AudioSegment
from pydub.utils import mediainfo
import librosa
import numpy as np
import scipy
import soundfile as sf
def frame_rate_channel(audio_file_name, head):
with wave.open(os.path.join(head,'tmp.wav'), "rb") as wave_file:
f... | true | true |
1c12a95e4cc00d5ab2641b7096e6d7e32cc224f4 | 9,128 | py | Python | scripts/fuzzing/test/test_e2e.py | EnderNightLord-ChromeBook/zircon-rpi | b09b1eb3aa7a127c65568229fe10edd251869283 | [
"BSD-2-Clause"
] | null | null | null | scripts/fuzzing/test/test_e2e.py | EnderNightLord-ChromeBook/zircon-rpi | b09b1eb3aa7a127c65568229fe10edd251869283 | [
"BSD-2-Clause"
] | null | null | null | scripts/fuzzing/test/test_e2e.py | EnderNightLord-ChromeBook/zircon-rpi | b09b1eb3aa7a127c65568229fe10edd251869283 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import glob
import os
import shutil
import struct
import sys
import tempfile
import unittest
import test_env
import lib.command as comm... | 36.658635 | 78 | 0.623904 |
import glob
import os
import shutil
import struct
import sys
import tempfile
import unittest
import test_env
import lib.command as command
from lib.host import Host
from lib.factory import Factory
from test_case import TestCaseWithIO
def load_tests(loader, standard_tests, pattern):
if Factory().parser.parse_arg... | true | true |
1c12a97039e1fdf9e42c0f4c40d258ebdab3969a | 9,030 | py | Python | django-covid/dashboard/views.py | Falcao5/COVID-19 | 8c29a8f5c8fa9c1b6d005a4b15c44cec2e9d3ae0 | [
"CC-BY-4.0"
] | null | null | null | django-covid/dashboard/views.py | Falcao5/COVID-19 | 8c29a8f5c8fa9c1b6d005a4b15c44cec2e9d3ae0 | [
"CC-BY-4.0"
] | null | null | null | django-covid/dashboard/views.py | Falcao5/COVID-19 | 8c29a8f5c8fa9c1b6d005a4b15c44cec2e9d3ae0 | [
"CC-BY-4.0"
] | 1 | 2021-07-15T22:05:10.000Z | 2021-07-15T22:05:10.000Z | from django.shortcuts import render
# ref: https://docs.djangoproject.com/en/3.0/intro/tutorial03/
from django.http import HttpResponse
from django.core import serializers
from dashboard.models import Regione, Nazione, Provincia
def calculateDetailsForState():
labels = set()
ricoverati_con_sintomi = []
t... | 33.947368 | 121 | 0.686157 | from django.shortcuts import render
from django.http import HttpResponse
from django.core import serializers
from dashboard.models import Regione, Nazione, Provincia
def calculateDetailsForState():
labels = set()
ricoverati_con_sintomi = []
terapia_intensiva = []
totale_ospedalizzati = []
isolame... | true | true |
1c12a9b7de6d7155b6a16494e722397f2a2c8e50 | 9,560 | py | Python | WorkStatusForNetTrafficWithDjango/WorkStatusForNetTrafficWithDjango/dashboard/util.py | Ayi-/WorkStatusForNetTrafficMonitorAndClassify | 67d04f83d6cf69b7efc351f473b125b029551cb1 | [
"MIT"
] | null | null | null | WorkStatusForNetTrafficWithDjango/WorkStatusForNetTrafficWithDjango/dashboard/util.py | Ayi-/WorkStatusForNetTrafficMonitorAndClassify | 67d04f83d6cf69b7efc351f473b125b029551cb1 | [
"MIT"
] | null | null | null | WorkStatusForNetTrafficWithDjango/WorkStatusForNetTrafficWithDjango/dashboard/util.py | Ayi-/WorkStatusForNetTrafficMonitorAndClassify | 67d04f83d6cf69b7efc351f473b125b029551cb1 | [
"MIT"
] | null | null | null | # coding=utf-8
from __future__ import print_function
import uuid
from calendar import timegm
import datetime
import jwt
from django.conf import settings
from django.contrib.auth import _get_user_session_key, _get_backends, SESSION_KEY, HASH_SESSION_KEY, \
BACKEND_SESSION_KEY, \
REDIRECT_FIELD_NAME
from django... | 33.310105 | 109 | 0.638075 | from __future__ import print_function
import uuid
from calendar import timegm
import datetime
import jwt
from django.conf import settings
from django.contrib.auth import _get_user_session_key, _get_backends, SESSION_KEY, HASH_SESSION_KEY, \
BACKEND_SESSION_KEY, \
REDIRECT_FIELD_NAME
from django.contrib.auth i... | true | true |
1c12a9defb1a5f3769c866175905ccaa139104d0 | 891 | py | Python | share/qt/clean_mac_info_plist.py | chalkcoin/chalkcoinsource | 112b08c5dceac98404628da8658d80557ef97454 | [
"MIT"
] | null | null | null | share/qt/clean_mac_info_plist.py | chalkcoin/chalkcoinsource | 112b08c5dceac98404628da8658d80557ef97454 | [
"MIT"
] | null | null | null | share/qt/clean_mac_info_plist.py | chalkcoin/chalkcoinsource | 112b08c5dceac98404628da8658d80557ef97454 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the chalk-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
inFil... | 29.7 | 109 | 0.723906 |
from string import Template
from datetime import date
bitcoinDir = "./";
inFile = bitcoinDir+"/share/qt/Info.plist"
outFile = "chalk-Qt.app/Contents/Info.plist"
version = "unknown";
fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro"
for line in open(fileForGrabbingVersion):
lineArr = line.replace(" ", ... | false | true |
1c12aac2b91a48eca604f83042b6c0daa9b1d505 | 6,065 | py | Python | run_coref.py | ariecattan/s2e-coref | 2ebe126902f7a939f486a05e8ae036032a26a10a | [
"MIT"
] | 25 | 2021-01-25T15:40:42.000Z | 2022-01-10T03:18:16.000Z | run_coref.py | ariecattan/s2e-coref | 2ebe126902f7a939f486a05e8ae036032a26a10a | [
"MIT"
] | 5 | 2021-03-13T18:47:18.000Z | 2022-03-15T06:46:30.000Z | run_coref.py | ariecattan/s2e-coref | 2ebe126902f7a939f486a05e8ae036032a26a10a | [
"MIT"
] | 8 | 2021-01-27T00:05:01.000Z | 2021-12-07T15:36:10.000Z | from __future__ import absolute_import, division, print_function
import logging
import os
import shutil
import git
import torch
from transformers import AutoConfig, AutoTokenizer, CONFIG_MAPPING, LongformerConfig, RobertaConfig
from modeling import S2E
from data import get_dataset
from cli import parse_args
from tra... | 38.878205 | 136 | 0.676505 | from __future__ import absolute_import, division, print_function
import logging
import os
import shutil
import git
import torch
from transformers import AutoConfig, AutoTokenizer, CONFIG_MAPPING, LongformerConfig, RobertaConfig
from modeling import S2E
from data import get_dataset
from cli import parse_args
from tra... | true | true |
1c12abc9e4bc51536612cefbdfe3d8aa614d3230 | 1,302 | py | Python | adv/w_aoi.py | haukist/dl | cf62d78ae973868bb0fc803faf77840cfe2fd6fd | [
"Apache-2.0"
] | null | null | null | adv/w_aoi.py | haukist/dl | cf62d78ae973868bb0fc803faf77840cfe2fd6fd | [
"Apache-2.0"
] | null | null | null | adv/w_aoi.py | haukist/dl | cf62d78ae973868bb0fc803faf77840cfe2fd6fd | [
"Apache-2.0"
] | null | null | null | import adv_test
import adv
def module():
return W_Aoi
class W_Aoi(adv.Adv):
comment = ''
a3 = ('sp',0.12,'fs')
def pre(this):
if this.condition('big hitbox'):
this.s1_addition = 4
else:
this.s1_addition = 1
def init(this):
this.sleep_last = 0
... | 22.067797 | 52 | 0.513057 | import adv_test
import adv
def module():
return W_Aoi
class W_Aoi(adv.Adv):
comment = ''
a3 = ('sp',0.12,'fs')
def pre(this):
if this.condition('big hitbox'):
this.s1_addition = 4
else:
this.s1_addition = 1
def init(this):
this.sleep_last = 0
... | true | true |
1c12ac5c9b22de7e8a65aa52ba8d187e6036914e | 4,301 | py | Python | alipay/aop/api/request/AlipayEbppConfigProvinceSearchRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayEbppConfigProvinceSearchRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayEbppConfigProvinceSearchRequest.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
class AlipayEbppConfigProvinceSearchRequest(object):
def __init__(self, biz_model=None):
self._biz_model = biz_model
self._o... | 27.928571 | 172 | 0.637294 | import simplejson as json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
class AlipayEbppConfigProvinceSearchRequest(object):
def __init__(self, biz_model=None):
self._biz_model = biz_model
self._order_type = None
self._sub_order_type ... | true | true |
1c12acb1d41bb3f7145c3d8afcf0042a3ede95e9 | 1,214 | py | Python | tests/test_node_utils.py | cthoyt/pybel-tools | 0bc9f9267178d164dab210f24255793cf4e32ab0 | [
"MIT"
] | 6 | 2017-03-09T14:28:19.000Z | 2019-11-21T00:00:15.000Z | tests/test_node_utils.py | pybel/pybel-tools | 0bc9f9267178d164dab210f24255793cf4e32ab0 | [
"MIT"
] | 134 | 2016-11-24T11:10:03.000Z | 2020-09-10T17:03:13.000Z | tests/test_node_utils.py | cthoyt/pybel-tools | 0bc9f9267178d164dab210f24255793cf4e32ab0 | [
"MIT"
] | 5 | 2017-03-08T13:28:02.000Z | 2020-04-05T02:23:17.000Z | # -*- coding: utf-8 -*-
"""Tests for node utilities."""
import unittest
from pybel import BELGraph
from pybel.dsl import Protein
from pybel.testing.utils import n
from pybel_tools.mutation.collapse import collapse_nodes_with_same_names
class TestMerge(unittest.TestCase):
def test_merge_nodes_by_name(self):
... | 39.16129 | 114 | 0.687809 |
import unittest
from pybel import BELGraph
from pybel.dsl import Protein
from pybel.testing.utils import n
from pybel_tools.mutation.collapse import collapse_nodes_with_same_names
class TestMerge(unittest.TestCase):
def test_merge_nodes_by_name(self):
graph = BELGraph()
priority = ['ncbigene', ... | true | true |
1c12ad018b717e6d187863e4a15cd16cd442ec69 | 8,992 | py | Python | emission/net/ext_service/habitica/proxy.py | trevor-wu/e-mission-server | 2e31986bd7c0faab7110b7eb69541b0b9eac62df | [
"BSD-3-Clause"
] | 1 | 2020-05-28T08:06:41.000Z | 2020-05-28T08:06:41.000Z | emission/net/ext_service/habitica/proxy.py | trevor-wu/e-mission-server | 2e31986bd7c0faab7110b7eb69541b0b9eac62df | [
"BSD-3-Clause"
] | null | null | null | emission/net/ext_service/habitica/proxy.py | trevor-wu/e-mission-server | 2e31986bd7c0faab7110b7eb69541b0b9eac62df | [
"BSD-3-Clause"
] | 1 | 2021-11-15T10:22:41.000Z | 2021-11-15T10:22:41.000Z | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import *
import json
import requests
import logging
import urllib.r... | 45.414141 | 317 | 0.697509 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import *
import json
import requests
import logging
import urllib.request, urllib.erro... | true | true |
1c12ad60913025fbd81dceb4d28ce4c28a7b50ec | 8,744 | py | Python | fairseq_cli/eval_lm.py | kayoyin/DialogueMT | aa426ebcdbdfe0366ed06081a842945f2108e85f | [
"MIT"
] | 1 | 2020-08-31T13:41:50.000Z | 2020-08-31T13:41:50.000Z | fairseq_cli/eval_lm.py | kayoyin/DialogueMT | aa426ebcdbdfe0366ed06081a842945f2108e85f | [
"MIT"
] | null | null | null | fairseq_cli/eval_lm.py | kayoyin/DialogueMT | aa426ebcdbdfe0366ed06081a842945f2108e85f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3 -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Evaluate the perplexity of a trained language model.
"""
import logging
import math
import os
import torch
fr... | 34.15625 | 112 | 0.584973 |
import logging
import math
import os
import torch
from fairseq import checkpoint_utils, options, tasks, utils
from fairseq.data import LMContextWindowDataset
from fairseq.logging import progress_bar
from fairseq.logging.meters import StopwatchMeter, TimeMeter
from fairseq.sequence_scorer import SequenceScorer
from ... | true | true |
1c12ad7bbd38111b90155311751931db666a3f02 | 2,223 | py | Python | cogs/morse.py | sundharvs/CipherBot | 9a1587455c3876f8ebf932a91ad0b0e49d13a412 | [
"MIT"
] | null | null | null | cogs/morse.py | sundharvs/CipherBot | 9a1587455c3876f8ebf932a91ad0b0e49d13a412 | [
"MIT"
] | 9 | 2019-11-12T02:33:51.000Z | 2019-11-12T02:58:55.000Z | cogs/morse.py | sundharvs/CipherBot | 9a1587455c3876f8ebf932a91ad0b0e49d13a412 | [
"MIT"
] | 1 | 2019-11-12T02:28:12.000Z | 2019-11-12T02:28:12.000Z | import quote
import random
from string import punctuation
from data import db
import discord
from discord.ext import commands
MORSE_CODE_DICT = { 'A':'.-', 'B':'-...',
'C':'-.-.', 'D':'-..', 'E':'.',
'F':'..-.', 'G':'--.', 'H':'....',
'I':'..', 'J':'.---',... | 36.442623 | 88 | 0.385965 | import quote
import random
from string import punctuation
from data import db
import discord
from discord.ext import commands
MORSE_CODE_DICT = { 'A':'.-', 'B':'-...',
'C':'-.-.', 'D':'-..', 'E':'.',
'F':'..-.', 'G':'--.', 'H':'....',
'I':'..', 'J':'.---',... | true | true |
1c12ad8b2a941dbe88aed99add6ba4b24484494a | 1,993 | py | Python | compiler/tests/04_precharge_test.py | ajaymr12/openram | b46fb724b603c79445bd5601db230468684ad233 | [
"BSD-3-Clause"
] | null | null | null | compiler/tests/04_precharge_test.py | ajaymr12/openram | b46fb724b603c79445bd5601db230468684ad233 | [
"BSD-3-Clause"
] | null | null | null | compiler/tests/04_precharge_test.py | ajaymr12/openram | b46fb724b603c79445bd5601db230468684ad233 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2019 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import unittest
from test... | 34.362069 | 96 | 0.679378 | import unittest
from testutils import *
import sys,os
sys.path.append(os.getenv("OPENRAM_HOME"))
import globals
from globals import OPTS
from sram_factory import factory
import debug
class precharge_test(openram_test):
def runTest(self):
config_file = "{}/tests/configs/config".format(os.getenv("OPENRAM_HO... | true | true |
1c12ae216498015b9c3585b429df7ae33f443d26 | 362 | py | Python | falcon/tests/test_response_body.py | kmt/falcon | b71d3a457704aa79543ba7b11b735e1cbd9875cd | [
"Apache-2.0"
] | 1 | 2016-03-04T19:34:26.000Z | 2016-03-04T19:34:26.000Z | falcon/tests/test_response_body.py | kmt/falcon | b71d3a457704aa79543ba7b11b735e1cbd9875cd | [
"Apache-2.0"
] | null | null | null | falcon/tests/test_response_body.py | kmt/falcon | b71d3a457704aa79543ba7b11b735e1cbd9875cd | [
"Apache-2.0"
] | null | null | null |
import falcon
import falcon.testing as testing
class TestResponseBody(testing.TestBase):
def test_append_body(self):
text = "Hello beautiful world! "
resp = falcon.Response()
resp.body = ""
for token in text.split():
resp.body += token
resp.body += " "
... | 20.111111 | 42 | 0.596685 |
import falcon
import falcon.testing as testing
class TestResponseBody(testing.TestBase):
def test_append_body(self):
text = "Hello beautiful world! "
resp = falcon.Response()
resp.body = ""
for token in text.split():
resp.body += token
resp.body += " "
... | true | true |
1c12b04f290e59d832c232ea6a8098b6aa68b95a | 659 | py | Python | Diena_1_4_thonny/d4_g1_u3.py | edzya/Python_RTU_08_20 | d2921d998c611c18328dd523daf976a27ce858c1 | [
"MIT"
] | 8 | 2020-08-31T16:10:54.000Z | 2021-11-24T06:37:37.000Z | Diena_1_4_thonny/d4_g1_u3.py | edzya/Python_RTU_08_20 | d2921d998c611c18328dd523daf976a27ce858c1 | [
"MIT"
] | 8 | 2021-06-08T22:30:29.000Z | 2022-03-12T00:48:55.000Z | Diena_1_4_thonny/d4_g1_u3.py | edzya/Python_RTU_08_20 | d2921d998c611c18328dd523daf976a27ce858c1 | [
"MIT"
] | 12 | 2020-09-28T17:06:52.000Z | 2022-02-17T12:12:46.000Z | # sk=int(input("Please enter any positive integer number:"))
# is_prime = True
# for i in range(2,sk):
# if not sk%i:
# is_prime = False
# break
# if is_prime:
# print(f"{sk} is prime")
# else:
# print(f"{sk} is not prime it divides by {i}")
import math
num=int(input('Please enter natural p... | 27.458333 | 80 | 0.602428 |
import math
num=int(input('Please enter natural positive number'))
end = math.ceil(math.sqrt(num))
i = 1
while i < end:
i += 1
if num % i == 0:
print(f'Number is not a Prime number, because it can be divided by {i}')
break
elif i == end:
print(f'Number {num} is a Prime number') | true | true |
1c12b09234e9c35788e21bed52bad23604a74e8c | 1,689 | py | Python | vizier/engine/packages/pycell/command.py | sanchitcop19/web-api-async | a3fff70c3b62678f3c8ef8cc07f7c9b4fe155c69 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-10-21T03:01:39.000Z | 2020-06-05T01:43:00.000Z | vizier/engine/packages/pycell/command.py | sanchitcop19/web-api-async | a3fff70c3b62678f3c8ef8cc07f7c9b4fe155c69 | [
"ECL-2.0",
"Apache-2.0"
] | 56 | 2019-07-12T21:16:03.000Z | 2020-11-06T23:29:22.000Z | vizier/engine/packages/pycell/command.py | sanchitcop19/web-api-async | a3fff70c3b62678f3c8ef8cc07f7c9b4fe155c69 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-02-07T19:56:55.000Z | 2020-08-07T11:17:51.000Z | # Copyright (C) 2017-2019 New York University,
# University at Buffalo,
# Illinois Institute of Technology.
#
# 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 th... | 33.117647 | 85 | 0.695086 |
import vizier.engine.packages.base as pckg
import vizier.engine.packages.pycell.base as pycell
import vizier.viztrail.command as md
def python_cell(source, validate=False):
if validate:
packages = {pycell.PACKAGE_PYTHON: pckg.PackageIndex(pycell.PYTHON_COMMANDS)}
else:
packages = Non... | true | true |
1c12b0e67f10e4fd247a64add710b3433b053c51 | 732 | py | Python | setup.py | dsfulf/GeostatsPy | 6e6edbffac489bd542d44c7799b9cc00816da8ca | [
"MIT"
] | 284 | 2018-07-01T08:13:42.000Z | 2022-03-28T01:33:13.000Z | setup.py | dsfulf/GeostatsPy | 6e6edbffac489bd542d44c7799b9cc00816da8ca | [
"MIT"
] | 19 | 2019-02-11T11:37:24.000Z | 2021-10-05T17:33:47.000Z | setup.py | dsfulf/GeostatsPy | 6e6edbffac489bd542d44c7799b9cc00816da8ca | [
"MIT"
] | 141 | 2018-07-05T13:08:54.000Z | 2022-03-28T01:59:18.000Z | import setuptools
from geostatspy import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="geostatspy",
version=__version__,
author="Michael Pyrcz",
author_email="mpyrcz@austin.utexas.edu",
description="Geostatistical methods from GSLIB: Geosta... | 31.826087 | 115 | 0.709016 | import setuptools
from geostatspy import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="geostatspy",
version=__version__,
author="Michael Pyrcz",
author_email="mpyrcz@austin.utexas.edu",
description="Geostatistical methods from GSLIB: Geosta... | true | true |
1c12b21ef6ff6b43c7bf0626a43eca61e93fb555 | 1,192 | py | Python | mmrazor/utils/misc.py | HIT-cwh/mmrazor | 2dad24044d7f1dad88f20221f8fc071dd40fdd4f | [
"Apache-2.0"
] | 553 | 2021-12-23T11:43:35.000Z | 2022-03-31T01:04:20.000Z | mmrazor/utils/misc.py | HIT-cwh/mmrazor | 2dad24044d7f1dad88f20221f8fc071dd40fdd4f | [
"Apache-2.0"
] | 113 | 2021-12-23T12:09:06.000Z | 2022-03-30T10:13:42.000Z | mmrazor/utils/misc.py | HIT-cwh/mmrazor | 2dad24044d7f1dad88f20221f8fc071dd40fdd4f | [
"Apache-2.0"
] | 76 | 2021-12-23T11:48:39.000Z | 2022-03-29T11:24:35.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import glob
import os.path as osp
import warnings
def find_latest_checkpoint(path, suffix='pth'):
"""Find the latest checkpoint from the working directory.
Args:
path(str): The path to find checkpoints.
suffix(str): File extension. Defaults to p... | 30.564103 | 74 | 0.628356 | import glob
import os.path as osp
import warnings
def find_latest_checkpoint(path, suffix='pth'):
if not osp.exists(path):
warnings.warn('The path of checkpoints does not exist.')
return None
if osp.exists(osp.join(path, f'latest.{suffix}')):
return osp.join(path, f'latest.{suffix}')
... | true | true |
1c12b23b55fd8099c5354de66cfb2d0a1d74b34c | 2,829 | py | Python | config/settings/local.py | sango09/andromeda_api_rest | b4a3267146f4f9a985fb3f512e652d4ff354bba2 | [
"MIT"
] | 1 | 2021-09-08T18:58:16.000Z | 2021-09-08T18:58:16.000Z | config/settings/local.py | sango09/andromeda_api_rest | b4a3267146f4f9a985fb3f512e652d4ff354bba2 | [
"MIT"
] | null | null | null | config/settings/local.py | sango09/andromeda_api_rest | b4a3267146f4f9a985fb3f512e652d4ff354bba2 | [
"MIT"
] | null | null | null | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env(
"DJANGO_SECRET_KEY... | 41 | 97 | 0.59491 | from .base import * from .base import env
DEBUG = True
SECRET_KEY = env(
"DJANGO_SECRET_KEY",
default="q3SczbQFagRL053EcI7S9BdXVHMyzmcpFusnJvXxjmcxGujRdqxrYiZndJO1jehu",
)
ALLOWED_HOSTS = ["localhost", "0.0.0.0", "127.0.0.1"]
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.L... | true | true |
1c12b2966a6031e83ac5b222be096584b00ad94e | 2,288 | py | Python | examples/asyncio/websocket/slowsquare/client.py | admcnally/python | 7880cfc15821c1e942c54862b7fe470e7446c27e | [
"MIT"
] | 11 | 2016-09-14T21:58:37.000Z | 2019-01-28T21:56:14.000Z | examples/asyncio/websocket/slowsquare/client.py | gruns/autobahn-python | 3dbea62675247a9d15626aebe9cafc4b1182d8d9 | [
"MIT"
] | 1 | 2018-10-19T09:21:26.000Z | 2018-10-19T09:21:26.000Z | examples/asyncio/websocket/slowsquare/client.py | gruns/autobahn-python | 3dbea62675247a9d15626aebe9cafc4b1182d8d9 | [
"MIT"
] | 1 | 2019-12-26T21:33:12.000Z | 2019-12-26T21:33:12.000Z | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | 35.75 | 79 | 0.667395 |
from autobahn.asyncio.websocket import WebSocketClientProtocol, \
WebSocketClientFactory
import json
import random
class SlowSquareClientProtocol(WebSocketClientProtocol):
def onOpen(self):
x = 10. * random.random()
self.sendMessage(json.dumps(x).encode('utf8'))
print("Request to sq... | true | true |
1c12b305d48c546e7948fb349d3de68b01639cd3 | 4,312 | py | Python | homeassistant/components/rituals_perfume_genie/sensor.py | tuomaz/core | 13dee0f028789d0fe262155d800153dd3b05bc38 | [
"Apache-2.0"
] | 1 | 2020-09-07T06:31:20.000Z | 2020-09-07T06:31:20.000Z | homeassistant/components/rituals_perfume_genie/sensor.py | tuomaz/core | 13dee0f028789d0fe262155d800153dd3b05bc38 | [
"Apache-2.0"
] | 22 | 2021-05-12T06:44:11.000Z | 2022-01-13T03:44:40.000Z | homeassistant/components/rituals_perfume_genie/sensor.py | tuomaz/core | 13dee0f028789d0fe262155d800153dd3b05bc38 | [
"Apache-2.0"
] | null | null | null | """Support for Rituals Perfume Genie sensors."""
from typing import Callable
from pyrituals import Diffuser
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_SIGNAL_STRENGTH,
PERCENTAGE,
)
from homeassistant.core import HomeAssistant
... | 31.474453 | 84 | 0.694573 | from typing import Callable
from pyrituals import Diffuser
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_SIGNAL_STRENGTH,
PERCENTAGE,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator imp... | true | true |
1c12b31e41bc8e55c434f489b5116a2436d0b21c | 8,899 | py | Python | seqpos/lib/python2.7/site-packages/mercurial/hgweb/common.py | guanjue/seqpos | ab9308ad128547ca968a1d944490710e583703bc | [
"MIT"
] | null | null | null | seqpos/lib/python2.7/site-packages/mercurial/hgweb/common.py | guanjue/seqpos | ab9308ad128547ca968a1d944490710e583703bc | [
"MIT"
] | null | null | null | seqpos/lib/python2.7/site-packages/mercurial/hgweb/common.py | guanjue/seqpos | ab9308ad128547ca968a1d944490710e583703bc | [
"MIT"
] | null | null | null | # hgweb/common.py - Utility functions needed by hgweb_mod and hgwebdir_mod
#
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later... | 33.836502 | 78 | 0.66603 |
from __future__ import absolute_import
import base64
import errno
import mimetypes
import os
import stat
from .. import (
encoding,
pycompat,
util,
)
httpserver = util.httpserver
HTTP_OK = 200
HTTP_CREATED = 201
HTTP_NOT_MODIFIED = 304
HTTP_BAD_REQUEST = 400
HTTP_UNAUTHORIZED = 401
HTTP_FORBIDDEN = 403... | true | true |
1c12b54fb5343815387dd3c5dc966950877aeb85 | 2,276 | py | Python | utils/throttling.py | AngleMAXIN/nomooc | 0c06b8af405b8254c242b34e85b7cba99c8f5737 | [
"MIT"
] | 1 | 2019-12-04T03:20:16.000Z | 2019-12-04T03:20:16.000Z | utils/throttling.py | AngleMAXIN/NoMooc | 0c06b8af405b8254c242b34e85b7cba99c8f5737 | [
"MIT"
] | null | null | null | utils/throttling.py | AngleMAXIN/NoMooc | 0c06b8af405b8254c242b34e85b7cba99c8f5737 | [
"MIT"
] | null | null | null | import time
from utils.cache import cache
class TokenBucket:
"""
注意:对于单个key的操作不是线程安全的
"""
def __init__(self, key, capacity=None, fill_rate=None, default_capacity=None, redis_conn=cache):
"""
:param capacity: 最大容量
:param fill_rate: 填充速度/每秒
:param default_capacity: 初始容量
... | 31.611111 | 100 | 0.623462 | import time
from utils.cache import cache
class TokenBucket:
def __init__(self, key, capacity=None, fill_rate=None, default_capacity=None, redis_conn=cache):
self._key = key
self._capacity = capacity
self._fill_rate = fill_rate
self._default_capacity = default_capacity
self... | true | true |
1c12b595fe60babb5808ea799bd138f6788a25ec | 4,940 | py | Python | textx/cli/generate.py | hlouzada/textX | ac99d92da2d9a5c5d85cf3ffaacb1779b4a5a0c2 | [
"MIT"
] | 346 | 2018-12-30T18:47:09.000Z | 2022-03-31T23:07:13.000Z | textx/cli/generate.py | hlouzada/textX | ac99d92da2d9a5c5d85cf3ffaacb1779b4a5a0c2 | [
"MIT"
] | 183 | 2018-12-27T17:22:28.000Z | 2022-03-28T08:31:09.000Z | textx/cli/generate.py | hlouzada/textX | ac99d92da2d9a5c5d85cf3ffaacb1779b4a5a0c2 | [
"MIT"
] | 46 | 2019-01-01T07:58:04.000Z | 2022-01-01T14:15:38.000Z | import os
try:
import click
except ImportError:
raise Exception('textX must be installed with CLI dependencies to use '
'textx command.\npip install textX[cli]')
from textx import (metamodel_from_file,
metamodel_for_file,
metamodel_for_language,
... | 39.206349 | 79 | 0.574899 | import os
try:
import click
except ImportError:
raise Exception('textX must be installed with CLI dependencies to use '
'textx command.\npip install textX[cli]')
from textx import (metamodel_from_file,
metamodel_for_file,
metamodel_for_language,
... | true | true |
1c12b6037d3d175a15491396c92a074351c2ef18 | 11,537 | py | Python | integration-test/841-normalize-boundaries-kind.py | rinnyB/vector-datasource | 024909ed8245a4ad4a25c908413ba3602de6c335 | [
"MIT"
] | null | null | null | integration-test/841-normalize-boundaries-kind.py | rinnyB/vector-datasource | 024909ed8245a4ad4a25c908413ba3602de6c335 | [
"MIT"
] | 2 | 2021-03-31T20:22:37.000Z | 2021-12-13T20:50:11.000Z | integration-test/841-normalize-boundaries-kind.py | rinnyB/vector-datasource | 024909ed8245a4ad4a25c908413ba3602de6c335 | [
"MIT"
] | null | null | null | from . import FixtureTest
class NormalizeBoundariesKind(FixtureTest):
def test_aboriginal_lands_protected_area(self):
# Relation: Hoopa Valley Tribe
#
# Note: this is tagged as a "protected_area" rather than a political
# boundary, but it seems that some "protect_class" values indi... | 36.053125 | 76 | 0.505504 | from . import FixtureTest
class NormalizeBoundariesKind(FixtureTest):
def test_aboriginal_lands_protected_area(self):
import dsl
z, x, y = 16, 10237, 24570
self.generate_fixtures(
dsl.way(-6214773, dsl.tile_diagonal(z, x, y), {
... | true | true |
1c12b6489e9211c00113f8e661a627b5aaf5e914 | 5,759 | py | Python | cmsplugin_blog_categories/migrations/0003_auto__del_field_categoryplugin_category.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | null | null | null | cmsplugin_blog_categories/migrations/0003_auto__del_field_categoryplugin_category.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | 3 | 2020-02-11T22:01:45.000Z | 2021-06-10T17:38:13.000Z | cmsplugin_blog_categories/migrations/0003_auto__del_field_categoryplugin_category.py | bitmazk/cmsplugin-blog-categories | 05e2fa3d50a8501f3f3f9cab784269838079cc37 | [
"MIT"
] | null | null | null | # flake8: noqa
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'CategoryPlugin.category'
db.delete_column('cmsplugin_categoryplugin', 'cate... | 65.443182 | 166 | 0.609654 | import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.delete_column('cmsplugin_categoryplugin', 'category_id')
db.create_table('cmsplugin_blog_categories_categoryplug... | true | true |
1c12b708c6fe26b5e5db3f193413e3f1a65029e3 | 7,946 | py | Python | config/settings/production.py | majaeseong/votesystem | 624fadca0251a81c0417f3a3a23f3d6c38b1cf33 | [
"MIT"
] | null | null | null | config/settings/production.py | majaeseong/votesystem | 624fadca0251a81c0417f3a3a23f3d6c38b1cf33 | [
"MIT"
] | null | null | null | config/settings/production.py | majaeseong/votesystem | 624fadca0251a81c0417f3a3a23f3d6c38b1cf33 | [
"MIT"
] | null | null | null | from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env('DJANGO_SECRET_KEY')
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
ALLOWED... | 39.336634 | 96 | 0.606469 | from .base import * from .base import env
SECRET_KEY = env('DJANGO_SECRET_KEY')
ALLOWED_HOSTS = env.list('DJANGO_ALLOWED_HOSTS', default=['example.com'])
DATABASES['default'] = env.db('DATABASE_URL') DATABASES['default']['ATOMIC_REQUESTS'] = True DATABASES['default']['CONN_MAX_AGE'] = env.int('CONN_MAX_AGE', defau... | true | true |
1c12b7820f9113999a1a73c0448606e371836cf3 | 1,383 | py | Python | EMDetector/train/utils.py | jabae/detectEM | 2d1a5116164d0bed0a8ea767a227d05a8970a448 | [
"MIT"
] | 1 | 2021-02-14T06:41:05.000Z | 2021-02-14T06:41:05.000Z | EMDetector/train/utils.py | jabae/detectEM | 2d1a5116164d0bed0a8ea767a227d05a8970a448 | [
"MIT"
] | null | null | null | EMDetector/train/utils.py | jabae/detectEM | 2d1a5116164d0bed0a8ea767a227d05a8970a448 | [
"MIT"
] | null | null | null | from __future__ import print_function
import imp
import os
import numpy as np
import torch
from torch.nn.parallel import data_parallel
from torch.cuda import *
from train.data import Data
from train.model import Model
def load_model(opt):
# Create a model.
net = opt.net
net.cuda()
model = Model(ne... | 21.609375 | 66 | 0.660882 | from __future__ import print_function
import imp
import os
import numpy as np
import torch
from torch.nn.parallel import data_parallel
from torch.cuda import *
from train.data import Data
from train.model import Model
def load_model(opt):
net = opt.net
net.cuda()
model = Model(net, opt)
if op... | true | true |
1c12b84cd9c923a3c3da7c1bb83f8b3fa2bf59d5 | 873 | py | Python | tests/tests.py | anthrotype/obp-zopfli | 83d047ed6743b2d1f81c68529571cc3a9f811365 | [
"Apache-2.0"
] | 9 | 2017-10-31T01:39:50.000Z | 2021-07-03T02:31:54.000Z | tests/tests.py | anthrotype/obp-zopfli | 83d047ed6743b2d1f81c68529571cc3a9f811365 | [
"Apache-2.0"
] | 6 | 2017-10-26T09:17:23.000Z | 2021-08-09T10:07:21.000Z | tests/tests.py | anthrotype/obp-zopfli | 83d047ed6743b2d1f81c68529571cc3a9f811365 | [
"Apache-2.0"
] | 2 | 2018-05-06T08:02:41.000Z | 2021-08-06T20:38:35.000Z | #!/usr/bin/env python
import gzip
import unittest
import zlib
import zopfli.gzip
import zopfli.zlib
from io import BytesIO
class Tests(object):
data = unittest.__doc__.encode('utf-8')
def test_reversible(self):
data = self.data
self.assertEqual(self.decompress(self.compress(data)), data)
... | 25.676471 | 113 | 0.704467 |
import gzip
import unittest
import zlib
import zopfli.gzip
import zopfli.zlib
from io import BytesIO
class Tests(object):
data = unittest.__doc__.encode('utf-8')
def test_reversible(self):
data = self.data
self.assertEqual(self.decompress(self.compress(data)), data)
def test_iterations_h... | true | true |
1c12b91a0a1acc720b3ac80820af6ec000fa54a1 | 9,678 | py | Python | mogan/tests/tempest/api/test_servers.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | mogan/tests/tempest/api/test_servers.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | mogan/tests/tempest/api/test_servers.py | GURUIFENG9139/rocky-mogan | 6008c1d12b00e70d2cc651f7bd5d47968fc3aec7 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2016 Huawei Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 44.599078 | 79 | 0.657161 | import time
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
from mogan.tests.tempest.api import base
class BaremetalComputeAPIServersTest(base.BaseBaremetalComputeTest):
@classmethod
def resource_setup(cls):
super(BaremetalComputeAPIServersTest, cls).resource_setup()... | true | true |
1c12b91aede9770efcaeab74a7d2466e60935373 | 776 | py | Python | test_taxes.py | Kehrlann/python-iterations | c2f579404b90d1aae9d5518c5a3de2d4c985cda6 | [
"Apache-2.0"
] | null | null | null | test_taxes.py | Kehrlann/python-iterations | c2f579404b90d1aae9d5518c5a3de2d4c985cda6 | [
"Apache-2.0"
] | null | null | null | test_taxes.py | Kehrlann/python-iterations | c2f579404b90d1aae9d5518c5a3de2d4c985cda6 | [
"Apache-2.0"
] | null | null | null | import unittest
from taxes import taxes
from testing_utils import BaseTestCase
class TestTaxes(BaseTestCase):
def test_taxes(self):
test_cases = [
(0, 0),
(50000, 7500),
(12500, 0),
(5000, 0),
(16500, 800),
(30000, 3500),
... | 23.515152 | 82 | 0.521907 | import unittest
from taxes import taxes
from testing_utils import BaseTestCase
class TestTaxes(BaseTestCase):
def test_taxes(self):
test_cases = [
(0, 0),
(50000, 7500),
(12500, 0),
(5000, 0),
(16500, 800),
(30000, 3500),
... | true | true |
1c12ba25803e324c8fa27774cbc0867999f45cc4 | 427 | py | Python | solutions/22.py | karmazynow-a/aoc2015 | 42bbfd8bf3336fe81e9cd865aec9c281c059ee6b | [
"MIT"
] | 1 | 2018-03-18T20:14:03.000Z | 2018-03-18T20:14:03.000Z | solutions/22.py | karmazynow-a/aoc2015 | 42bbfd8bf3336fe81e9cd865aec9c281c059ee6b | [
"MIT"
] | null | null | null | solutions/22.py | karmazynow-a/aoc2015 | 42bbfd8bf3336fe81e9cd865aec9c281c059ee6b | [
"MIT"
] | null | null | null | #AoC2015 day2 part2
def smallest (l=0,w=0,h=0):
a = 2*l + 2*w
b = 2*l + 2*h
c = 2*w + 2*h
if a < b:
if c < a: return c
else: return a
else:
if c < b: return c
else: return b
def surface (l=0,w=0,h=0):
return l*w*h + smallest (l,w,h)
suma = 0
with open("input") as f:
for line in f:
if not line: ... | 14.233333 | 55 | 0.552693 |
def smallest (l=0,w=0,h=0):
a = 2*l + 2*w
b = 2*l + 2*h
c = 2*w + 2*h
if a < b:
if c < a: return c
else: return a
else:
if c < b: return c
else: return b
def surface (l=0,w=0,h=0):
return l*w*h + smallest (l,w,h)
suma = 0
with open("input") as f:
for line in f:
if not line: break
a=line.s... | false | true |
1c12ba2c7a47631dcf8b150f1599de4937fbd817 | 18,928 | py | Python | trilearn/graph/junction_tree.py | melmasri/trilearn | cbda999140881a5f0e01d75a54d5ff55201a33e7 | [
"Apache-2.0"
] | null | null | null | trilearn/graph/junction_tree.py | melmasri/trilearn | cbda999140881a5f0e01d75a54d5ff55201a33e7 | [
"Apache-2.0"
] | null | null | null | trilearn/graph/junction_tree.py | melmasri/trilearn | cbda999140881a5f0e01d75a54d5ff55201a33e7 | [
"Apache-2.0"
] | null | null | null | """
Functions related to junction trees.
"""
import networkx as nx
import numpy as np
import trilearn.graph.junction_tree_expander as jte
class JunctionTree(nx.Graph):
def __init__(self, data=None, **attr):
nx.Graph.__init__(self, data, **attr)
self.log_nus = {}
self.separators = None
... | 28.722307 | 153 | 0.564877 |
import networkx as nx
import numpy as np
import trilearn.graph.junction_tree_expander as jte
class JunctionTree(nx.Graph):
def __init__(self, data=None, **attr):
nx.Graph.__init__(self, data, **attr)
self.log_nus = {}
self.separators = None
def log_nu(self, sep):
if sep not... | true | true |
1c12ba8c8e423df8c45a35dc7bd856b8b7139f7e | 3,117 | py | Python | q2_fondue/types/_transformer.py | bokulich-lab/q2-fondue | 8afd9f61d4faff9a5210b8105d039551685329ab | [
"BSD-3-Clause"
] | 10 | 2022-03-21T16:07:22.000Z | 2022-03-31T09:33:48.000Z | q2_fondue/types/_transformer.py | bokulich-lab/q2-fondue | 8afd9f61d4faff9a5210b8105d039551685329ab | [
"BSD-3-Clause"
] | null | null | null | q2_fondue/types/_transformer.py | bokulich-lab/q2-fondue | 8afd9f61d4faff9a5210b8105d039551685329ab | [
"BSD-3-Clause"
] | 4 | 2022-03-21T06:51:44.000Z | 2022-03-29T15:56:14.000Z | # ----------------------------------------------------------------------------
# Copyright (c) 2022, Bokulich Laboratories.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# --------------------------------------------------------... | 27.584071 | 78 | 0.643568 |
import pandas as pd
import qiime2
from ..plugin_setup import plugin
from ._format import (
SRAMetadataFormat, SRAFailedIDsFormat, NCBIAccessionIDsFormat
)
def _meta_fmt_to_metadata(ff):
with ff.open() as fh:
df = pd.read_csv(fh, sep='\t', header=0, index_col=0, dtype='str')
return qiime2.Met... | true | true |
1c12bbd9c04687263ae0e114afab2795762a893f | 7,492 | py | Python | rmepy/robot_modules/chassis.py | 233a344a455/RobomasterEPlib | d0497d06d107c482e7b4c80c54c7c05c0bf62e21 | [
"MIT"
] | 3 | 2020-04-23T14:19:59.000Z | 2020-10-06T17:02:12.000Z | rmepy/robot_modules/chassis.py | 233a344a455/RobomasterEPlib | d0497d06d107c482e7b4c80c54c7c05c0bf62e21 | [
"MIT"
] | null | null | null | rmepy/robot_modules/chassis.py | 233a344a455/RobomasterEPlib | d0497d06d107c482e7b4c80c54c7c05c0bf62e21 | [
"MIT"
] | 2 | 2020-05-13T08:15:16.000Z | 2020-05-13T08:55:51.000Z | from .__module_template import RobotModuleTemplate
from ..decorators import accepts
class Chassis(RobotModuleTemplate):
def __init__(self, robot):
super().__init__(robot)
# position 底盘当前的位置距离上电时刻位置
self.x = 0.0 # x 轴位置(m)
self.y = 0.0 # y 轴位置(m)
# attitude
self.... | 28.378788 | 133 | 0.491057 | from .__module_template import RobotModuleTemplate
from ..decorators import accepts
class Chassis(RobotModuleTemplate):
def __init__(self, robot):
super().__init__(robot)
self.x = 0.0 self.y = 0.0
self.pitch = 0.0
self.roll = 0.0
self.yaw = 0.0
... | true | true |
1c12bc348ce5f09a48e48eb9d6c5ff9c8d012be8 | 28,920 | py | Python | tests/test_basics/py/ShExJ.py | hsolbrig/pyjsg | 5ef46d9af6a94a0cd0e91ebf8b22f61c17e78429 | [
"CC0-1.0"
] | 3 | 2017-07-23T11:11:23.000Z | 2020-11-30T15:36:51.000Z | tests/test_jsglib/py/ShExJ.py | hsolbrig/pyjsg | 5ef46d9af6a94a0cd0e91ebf8b22f61c17e78429 | [
"CC0-1.0"
] | 15 | 2018-01-05T17:18:34.000Z | 2021-12-13T17:40:25.000Z | try2/lib/python3.9/site-packages/ShExJSG-0.7.1-py3.9.egg/ShExJSG/ShExJ.py | diatomsRcool/eco-kg | 4251f42ca2ab353838a39b640cb97593db76d4f4 | [
"BSD-3-Clause"
] | 1 | 2018-10-21T12:44:01.000Z | 2018-10-21T12:44:01.000Z | import typing
import pyjsg.jsglib as jsg
# .TYPE and .IGNORE settings
_CONTEXT = jsg.JSGContext()
_CONTEXT.TYPE = "type"
_CONTEXT.TYPE_EXCEPTIONS.append("ObjectLiteral")
_CONTEXT.TYPE_EXCEPTIONS.append("InnerContext")
class _Anon1(jsg.JSGString):
pattern = jsg.JSGPattern(r'http://www\.w3\.org/ns/shex\.jsonld')
... | 40.055402 | 238 | 0.59917 | import typing
import pyjsg.jsglib as jsg
_CONTEXT = jsg.JSGContext()
_CONTEXT.TYPE = "type"
_CONTEXT.TYPE_EXCEPTIONS.append("ObjectLiteral")
_CONTEXT.TYPE_EXCEPTIONS.append("InnerContext")
class _Anon1(jsg.JSGString):
pattern = jsg.JSGPattern(r'http://www\.w3\.org/ns/shex\.jsonld')
class _Anon2(jsg.JSGString):... | true | true |
1c12bd3d7599ee90eae0f87d7af6aa5d572a9a56 | 3,077 | py | Python | platformio/project/savedeps.py | ufo2011/platformio-core | 0ceae62701731f8b32c34d7993a34dea34aea59c | [
"Apache-2.0"
] | null | null | null | platformio/project/savedeps.py | ufo2011/platformio-core | 0ceae62701731f8b32c34d7993a34dea34aea59c | [
"Apache-2.0"
] | null | null | null | platformio/project/savedeps.py | ufo2011/platformio-core | 0ceae62701731f8b32c34d7993a34dea34aea59c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 34.965909 | 86 | 0.631784 |
import os
from platformio.compat import ci_strings_are_equal
from platformio.package.meta import PackageSpec
from platformio.project.config import ProjectConfig
from platformio.project.exception import InvalidProjectConfError
def pkg_to_save_spec(pkg, user_spec):
assert isinstance(user_spec, PackageSpec)
if... | true | true |
1c12bf97182a380919f71c44e8ffae35648b1cc3 | 223 | py | Python | docs/examples/tutorial/profiling_tutorial/profile.py | aparamon/cython | 5dfefdadf6c20bf631ea3b6e567eede2f1ddd3d0 | [
"Apache-2.0"
] | 1 | 2016-02-10T13:29:17.000Z | 2016-02-10T13:29:17.000Z | docs/examples/tutorial/profiling_tutorial/profile.py | aparamon/cython | 5dfefdadf6c20bf631ea3b6e567eede2f1ddd3d0 | [
"Apache-2.0"
] | null | null | null | docs/examples/tutorial/profiling_tutorial/profile.py | aparamon/cython | 5dfefdadf6c20bf631ea3b6e567eede2f1ddd3d0 | [
"Apache-2.0"
] | 2 | 2017-06-18T04:09:18.000Z | 2018-11-30T20:03:58.000Z | # profile.py
import pstats, cProfile
import calc_pi
cProfile.runctx("calc_pi.approx_pi()", globals(), locals(), "Profile.prof")
s = pstats.Stats("Profile.prof")
s.strip_dirs().sort_stats("time").print_stats()
| 20.272727 | 76 | 0.695067 |
import pstats, cProfile
import calc_pi
cProfile.runctx("calc_pi.approx_pi()", globals(), locals(), "Profile.prof")
s = pstats.Stats("Profile.prof")
s.strip_dirs().sort_stats("time").print_stats()
| true | true |
1c12bf9fd6b2a7b3a017aa3a6d450470454850a1 | 1,119 | py | Python | img_resize.py | vbhave/image-manipulation | 128e2ae53748eddad857f38d7013708dfe20a1ec | [
"MIT"
] | null | null | null | img_resize.py | vbhave/image-manipulation | 128e2ae53748eddad857f38d7013708dfe20a1ec | [
"MIT"
] | null | null | null | img_resize.py | vbhave/image-manipulation | 128e2ae53748eddad857f38d7013708dfe20a1ec | [
"MIT"
] | null | null | null | # Used to resize all images in list of directories
# Input: Source and Destination folders. Source Folders should contain
# list of images to be resized.
# Method: Each image in source folders is resized and put into the
# correspinding destination folders with the same name
# Output: Destinatio... | 34.96875 | 74 | 0.734584 |
import os
from PIL import Image
sourceFolders = ['images/', '0/', '1/']
destinationFolders = ['images_resize/', '0_resize/', '1_resize/']
for i in range(len(sourceFolders)):
sourceFolder = sourceFolders[i]
destinationFolder = destinationFolders[i]
files = os.listdir(sourceFolder)
for file in files:
img = I... | true | true |
1c12c0297f4a02b6d33d4ca815c1d7467aec411e | 23,857 | py | Python | image_classification/ViT/main_multi_gpu.py | libertatis/PaddleViT | 422b7fa4dda68c158fc9bd95e00aba01d4671916 | [
"Apache-2.0"
] | 1 | 2021-12-28T07:08:58.000Z | 2021-12-28T07:08:58.000Z | image_classification/ViT/main_multi_gpu.py | libertatis/PaddleViT | 422b7fa4dda68c158fc9bd95e00aba01d4671916 | [
"Apache-2.0"
] | null | null | null | image_classification/ViT/main_multi_gpu.py | libertatis/PaddleViT | 422b7fa4dda68c158fc9bd95e00aba01d4671916 | [
"Apache-2.0"
] | 1 | 2022-01-10T04:52:21.000Z | 2022-01-10T04:52:21.000Z | # Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 44.016605 | 98 | 0.605273 |
import sys
import os
import time
import logging
import argparse
import random
import numpy as np
import paddle
import paddle.nn as nn
import paddle.nn.functional as F
import paddle.distributed as dist
from datasets import get_dataloader
from datasets import get_dataset
from utils import AverageMeter
from utils import... | true | true |
1c12c039d37c3c5487ab42bec051ce1a615fc043 | 5,363 | py | Python | forml/conf/parsed/__init__.py | mpearmain/forml | 3d69d27b1a64a237c739d2795512b6f9296d3874 | [
"Apache-2.0"
] | null | null | null | forml/conf/parsed/__init__.py | mpearmain/forml | 3d69d27b1a64a237c739d2795512b6f9296d3874 | [
"Apache-2.0"
] | null | null | null | forml/conf/parsed/__init__.py | mpearmain/forml | 3d69d27b1a64a237c739d2795512b6f9296d3874 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.159236 | 114 | 0.665859 |
import abc
import operator
import types
import typing
from forml import error, conf
class Meta(abc.ABCMeta):
def __new__(mcs, name: str, bases: typing.Tuple[typing.Type], namespace: typing.Dict[str, typing.Any]):
if 'FIELDS' in namespace:
for index, field in enumerate(namespace.pop('FIELDS'... | true | true |
1c12c14e47d3ab4cb19046f9c4428a19e7cec6fc | 3,163 | py | Python | isign/isign.py | kpandroid/isign | 2c368136dbf67a8aa685dd85dc930cb0dcb6a096 | [
"Apache-2.0"
] | null | null | null | isign/isign.py | kpandroid/isign | 2c368136dbf67a8aa685dd85dc930cb0dcb6a096 | [
"Apache-2.0"
] | null | null | null | isign/isign.py | kpandroid/isign | 2c368136dbf67a8aa685dd85dc930cb0dcb6a096 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# import makesig
import exceptions
import os
import archive
from archive import Archive, resign
from os.path import dirname, exists, join, realpath, expanduser
# this comes with the repo
PACKAGE_ROOT = dirname(realpath(__file__))
DEFAULT_APPLE_CERT_PATH = join(PACKAGE_ROOT, 'apple_credentials',... | 32.947917 | 83 | 0.63895 | import exceptions
import os
import archive
from archive import Archive, resign
from os.path import dirname, exists, join, realpath, expanduser
PACKAGE_ROOT = dirname(realpath(__file__))
DEFAULT_APPLE_CERT_PATH = join(PACKAGE_ROOT, 'apple_credentials', 'applecerts.pem')
DEFAULT_CREDENTIAL_FILE_NAMES = {
'certificat... | true | true |
1c12c23712b47f73a90f239e3d4770e8abe99288 | 7,566 | py | Python | sdk/python/pulumi_azure_native/documentdb/v20150401/database_account_cassandra_keyspace.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/documentdb/v20150401/database_account_cassandra_keyspace.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/documentdb/v20150401/database_account_cassandra_keyspace.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 54.042857 | 1,204 | 0.685831 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ._inputs import *
__all__ = ['DatabaseAccountCassandraKeyspace']
class DatabaseAccountCassandraKeyspace(pulumi.CustomResource):
def __init__(__self__,
... | true | true |
1c12c2bb5c4ea10350782212ac6a90da9c9c29d2 | 2,098 | py | Python | flask_collect/storage/base.py | klen/Flask-Collect | 2297e78a798ed701572de15747060b73c21817da | [
"BSD-3-Clause"
] | 27 | 2015-02-21T04:57:24.000Z | 2020-09-01T12:13:22.000Z | flask_collect/storage/base.py | mush42/Flask-Collect | 2297e78a798ed701572de15747060b73c21817da | [
"BSD-3-Clause"
] | 74 | 2015-01-07T11:44:28.000Z | 2021-05-12T10:44:49.000Z | flask_collect/storage/base.py | mush42/Flask-Collect | 2297e78a798ed701572de15747060b73c21817da | [
"BSD-3-Clause"
] | 8 | 2015-06-14T16:32:53.000Z | 2021-12-09T18:10:24.000Z | # -*- coding: utf-8 -*-
#
# This file is part of Flask-Collect.
# Copyright (C) 2012, 2013 Kirill Klenov.
# Copyright (C) 2014, 2016 CERN.
#
# Flask-Collect is free software; you can redistribute it and/or modify it
# under the terms of the Revised BSD License; see LICENSE file for
# more details.
"""Abstract File Sto... | 33.301587 | 79 | 0.529075 |
from __future__ import print_function
from os import path as op, walk
class BaseStorage(object):
def __init__(self, collect, verbose=False):
self.verbose = verbose
self.collect = collect
def __iter__(self):
app_and_blueprints = self.collect.filter(
[self.collect.app] ... | true | true |
1c12c443826c07e78dc0358aa88bb2dbef17f3db | 6,439 | py | Python | disclosure_mutual_diversity.py | liboyuty/Mutual-Cover | b5589004e8ecc4858fe6bc50b1a13393a07a01ec | [
"Apache-2.0"
] | null | null | null | disclosure_mutual_diversity.py | liboyuty/Mutual-Cover | b5589004e8ecc4858fe6bc50b1a13393a07a01ec | [
"Apache-2.0"
] | null | null | null | disclosure_mutual_diversity.py | liboyuty/Mutual-Cover | b5589004e8ecc4858fe6bc50b1a13393a07a01ec | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import random
random.seed(42)
class CheckDisclosure:
def __init__(self):
self.ori_path = "./filter_data.csv" # 原始数据路径
self.mutual_path = "./results/mutual_cover/diversity/mutual_" ... | 50.700787 | 119 | 0.517006 | import pandas as pd
import random
random.seed(42)
class CheckDisclosure:
def __init__(self):
self.ori_path = "./filter_data.csv" self.mutual_path = "./results/mutual_cover/diversity/mutual_" se... | true | true |
1c12c57a31b7e68cce0b5fc67ef3be6a29b7f30d | 63 | py | Python | enthought/util/wx/scrolled_message_dialog.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/util/wx/scrolled_message_dialog.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/util/wx/scrolled_message_dialog.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from pyface.wx.scrolled_message_dialog import *
| 21 | 47 | 0.825397 | from pyface.wx.scrolled_message_dialog import *
| true | true |
1c12c586613f514d78c7d39ca206abcdd015cf93 | 3,013 | py | Python | python/local/select_twic.py | andreavb/TWICTools | 34db9eeffcf3202a751d56a42690968a705304a6 | [
"Beerware"
] | 1 | 2022-02-12T13:41:51.000Z | 2022-02-12T13:41:51.000Z | python/local/select_twic.py | andreavb/TWICTools | 34db9eeffcf3202a751d56a42690968a705304a6 | [
"Beerware"
] | 1 | 2021-02-10T00:43:44.000Z | 2021-02-10T17:05:00.000Z | python/local/select_twic.py | andreavb/TWICTools | 34db9eeffcf3202a751d56a42690968a705304a6 | [
"Beerware"
] | null | null | null | import re
import zipfile
import platform
if platform.python_version().startswith('2'):
import urllib as ul
else:
import urllib.request as ul
def read_webpage():
# read through TWIC page and find the link that stands for the latest issue
twic_url = 'https://theweekinchess.com/twic'
str_source = ul... | 27.642202 | 106 | 0.691338 | import re
import zipfile
import platform
if platform.python_version().startswith('2'):
import urllib as ul
else:
import urllib.request as ul
def read_webpage():
twic_url = 'https://theweekinchess.com/twic'
str_source = ul.urlopen(twic_url).read().decode('utf-8')
last_link = re.findall(r'The l... | true | true |
1c12c58779a17c38736553b84a9e7f7698bfa544 | 952 | py | Python | BasicApp/migrations/0007_lookuptablesupdatestatus_stockdatalastupdate.py | bozcani/borsa-scraper-app | 56c767a9b6d6c9be40046aa03763f13465860f6f | [
"MIT"
] | 3 | 2020-02-06T10:05:29.000Z | 2020-04-18T10:11:37.000Z | BasicApp/migrations/0007_lookuptablesupdatestatus_stockdatalastupdate.py | bozcani/borsa | 56c767a9b6d6c9be40046aa03763f13465860f6f | [
"MIT"
] | 10 | 2020-02-06T08:50:13.000Z | 2020-04-25T12:17:17.000Z | BasicApp/migrations/0007_lookuptablesupdatestatus_stockdatalastupdate.py | bozcani/borsa-scraper-app | 56c767a9b6d6c9be40046aa03763f13465860f6f | [
"MIT"
] | 1 | 2020-02-06T07:40:06.000Z | 2020-02-06T07:40:06.000Z | # Generated by Django 3.0.2 on 2020-02-13 20:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('BasicApp', '0006_auto_20200209_2145'),
]
operations = [
migrations.CreateModel(
name='LookupTab... | 31.733333 | 156 | 0.596639 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('BasicApp', '0006_auto_20200209_2145'),
]
operations = [
migrations.CreateModel(
name='LookupTablesUpdateStatus',
fields=[
... | true | true |
1c12c5aa53cfe95030a71bf4fc6f3ab880595ad3 | 96,957 | py | Python | airflow/www/views.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-10-02T13:33:48.000Z | 2019-10-02T13:33:48.000Z | airflow/www/views.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-07-17T09:57:07.000Z | 2019-08-06T15:04:09.000Z | airflow/www/views.py | InigoSJ/airflow | 8b97a387dc30d8c88390d500ec99333798c20f1c | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-11-26T21:53:20.000Z | 2019-11-26T21:53:20.000Z | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | 37.420687 | 106 | 0.582898 |
import copy
import itertools
import json
import logging
import math
import os
import socket
import traceback
from collections import defaultdict
from datetime import timedelta
import markdown
import pendulum
import sqlalchemy as sqla
from flask import (Markup, Response, flash, jsonify, make_response, redirect,
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.