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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c15f3b4d10b758cabed9ee250df445bba4798a6 | 1,695 | py | Python | mode/GameModeObserver.py | philippehenri-gosselin/tankgame | ceabbee7c348bfd4c95d2ee2ae0015d6d761154b | [
"X11"
] | 4 | 2020-09-15T02:00:39.000Z | 2021-05-11T17:23:28.000Z | mode/GameModeObserver.py | philippehenri-gosselin/tankgame | ceabbee7c348bfd4c95d2ee2ae0015d6d761154b | [
"X11"
] | null | null | null | mode/GameModeObserver.py | philippehenri-gosselin/tankgame | ceabbee7c348bfd4c95d2ee2ae0015d6d761154b | [
"X11"
] | null | null | null | """
MIT License
Copyrights © 2020, Philippe-Henri Gosselin.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, m... | 38.522727 | 81 | 0.757522 | class GameModeObserver():
def loadLevelRequested(self, fileName):
pass
def worldSizeChanged(self, worldSize):
pass
def showMenuRequested(self):
pass
def showGameRequested(self):
pass
def gameWon(self):
pass
def gameLost(self):
pass
def quitRequ... | true | true |
1c15f3b89edd47fe1f1a3966e6b14da314f2f583 | 3,066 | py | Python | python/sparktk/frame/ops/map_columns.py | lewisc/spark-tk | 5548fc925b5c278263cbdebbd9e8c7593320c2f4 | [
"ECL-2.0",
"Apache-2.0"
] | 34 | 2016-05-20T22:26:05.000Z | 2022-01-21T12:55:13.000Z | python/sparktk/frame/ops/map_columns.py | aayushidwivedi01/spark-tk-old | fcf25f86498ac416cce77de0db4cf0aa503d20ac | [
"ECL-2.0",
"Apache-2.0"
] | 70 | 2016-06-28T01:11:21.000Z | 2021-03-15T21:40:01.000Z | python/sparktk/frame/ops/map_columns.py | aayushidwivedi01/spark-tk-old | fcf25f86498ac416cce77de0db4cf0aa503d20ac | [
"ECL-2.0",
"Apache-2.0"
] | 34 | 2016-04-21T22:25:22.000Z | 2020-10-06T09:23:43.000Z | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 require... | 34.840909 | 133 | 0.574038 |
from sparktk.frame.row import Row
import sparktk.frame.schema as schema_helper
def map_columns(self, func, schema):
schema_helper.validate(schema)
row = Row(self.schema)
def map_columns_func(r):
row._set_data(r)
return func(row)
if isinstance(schema, list):
rdd = self._pyth... | true | true |
1c15f47a5185d211ec1bfa7657ead664027599ae | 124 | py | Python | dace/transformation/subgraph/__init__.py | am-ivanov/dace | c35f0b3cecc04a2c9fb668bd42a72045891e7a42 | [
"BSD-3-Clause"
] | null | null | null | dace/transformation/subgraph/__init__.py | am-ivanov/dace | c35f0b3cecc04a2c9fb668bd42a72045891e7a42 | [
"BSD-3-Clause"
] | null | null | null | dace/transformation/subgraph/__init__.py | am-ivanov/dace | c35f0b3cecc04a2c9fb668bd42a72045891e7a42 | [
"BSD-3-Clause"
] | null | null | null | """ This module initializes the subgraph transformations package."""
from .gpu_persistent_fusion import GPUPersistentKernel | 41.333333 | 68 | 0.83871 |
from .gpu_persistent_fusion import GPUPersistentKernel | true | true |
1c15f48f1dd9737be787bcf95d86bb166df72540 | 791 | py | Python | scriptshop/mainapp/serializers.py | malfin/ScriptShop | f4c7e5f7fd6c6caaefad3c525277bd7a174dd96c | [
"Apache-2.0"
] | null | null | null | scriptshop/mainapp/serializers.py | malfin/ScriptShop | f4c7e5f7fd6c6caaefad3c525277bd7a174dd96c | [
"Apache-2.0"
] | null | null | null | scriptshop/mainapp/serializers.py | malfin/ScriptShop | f4c7e5f7fd6c6caaefad3c525277bd7a174dd96c | [
"Apache-2.0"
] | 1 | 2021-09-26T17:08:59.000Z | 2021-09-26T17:08:59.000Z | from rest_framework.serializers import ModelSerializer
from mainapp.models import Purchases, Product, Category
from authapp.models import UserProfile
class PurchasesSerializer(ModelSerializer):
class Meta:
model = Purchases
fields = '__all__'
class CategorySerializer(ModelSerializer):
class... | 20.815789 | 55 | 0.627054 | from rest_framework.serializers import ModelSerializer
from mainapp.models import Purchases, Product, Category
from authapp.models import UserProfile
class PurchasesSerializer(ModelSerializer):
class Meta:
model = Purchases
fields = '__all__'
class CategorySerializer(ModelSerializer):
class... | true | true |
1c15f4914895c5870121b7edf270531fe67382c9 | 4,028 | py | Python | life_line_chart/Translation.py | mustaqimM/life_line_chart | a9bbbbdeb5568aa0cc3b3b585337a3d655f4b2d6 | [
"MIT"
] | null | null | null | life_line_chart/Translation.py | mustaqimM/life_line_chart | a9bbbbdeb5568aa0cc3b3b585337a3d655f4b2d6 | [
"MIT"
] | null | null | null | life_line_chart/Translation.py | mustaqimM/life_line_chart | a9bbbbdeb5568aa0cc3b3b585337a3d655f4b2d6 | [
"MIT"
] | null | null | null | """
Translation
===========
This is a collection of methods to translate or simply update strings stored in a dict.
To add a new language just add a top-level dict in the json files and import one of the Charts.
The new language will be filled with all available strings, so the structure is aligned with the
default l... | 34.724138 | 118 | 0.630586 |
import os
from copy import deepcopy
import logging
import json
logger = logging.getLogger("life_line_chart")
def translate_strings(data, source_language='en_EN.UTF-8', destination_language='de_DE.UTF-8', translator=None):
if not translator:
try:
import googletrans
translator = goo... | true | true |
1c15f4c0672ffd268026e2dd4316fd23c14a1640 | 26,618 | py | Python | py/lvmspec/test/test_io.py | sdss/lvmspec | befd6991537c4947fdf63ca262937f2bb845148f | [
"BSD-3-Clause"
] | null | null | null | py/lvmspec/test/test_io.py | sdss/lvmspec | befd6991537c4947fdf63ca262937f2bb845148f | [
"BSD-3-Clause"
] | null | null | null | py/lvmspec/test/test_io.py | sdss/lvmspec | befd6991537c4947fdf63ca262937f2bb845148f | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Test lvmspec.io.
"""
from __future__ import absolute_import, division
# The line above will help with 2to3 support.
import unittest, os
import tempfile
from datetime import datetime, timedelta
from shutil import rmtree
from pkg_r... | 42.117089 | 128 | 0.6026 | from __future__ import absolute_import, division
import unittest, os
import tempfile
from datetime import datetime, timedelta
from shutil import rmtree
from pkg_resources import resource_filename
import numpy as np
from astropy.io import fits
from astropy.table import Table
from ..frame import Frame
class TestIO(unitt... | true | true |
1c15f7ac0f1ed2fbb47706bf33accf762cb7ee68 | 6,956 | py | Python | run.py | Joannsaj/password | fb364f8346e70077e5bbb542f0cabbf2296f7c4f | [
"MIT"
] | null | null | null | run.py | Joannsaj/password | fb364f8346e70077e5bbb542f0cabbf2296f7c4f | [
"MIT"
] | null | null | null | run.py | Joannsaj/password | fb364f8346e70077e5bbb542f0cabbf2296f7c4f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.8
from user import User
from credentials import Credentials
import random
import string
def create_user(username , password):
'''
Function to create a new user
'''
new_user = User(username , password)
return new_user
def save_user(user):
'''
Function to save user
... | 31.192825 | 184 | 0.569436 |
from user import User
from credentials import Credentials
import random
import string
def create_user(username , password):
new_user = User(username , password)
return new_user
def save_user(user):
user.save_user()
def del_user(user):
user.delete_user()
def authentic(username ,password):
return... | true | true |
1c15f7e2223d250035ffb6698bc606ee61630620 | 44,932 | py | Python | sushy_tools/emulator/resources/systems/libvirtdriver.py | yjian118/sushy-tools | 1553bf31823c2a36a90830de8e95e85d96af78dc | [
"Apache-2.0"
] | null | null | null | sushy_tools/emulator/resources/systems/libvirtdriver.py | yjian118/sushy-tools | 1553bf31823c2a36a90830de8e95e85d96af78dc | [
"Apache-2.0"
] | null | null | null | sushy_tools/emulator/resources/systems/libvirtdriver.py | yjian118/sushy-tools | 1553bf31823c2a36a90830de8e95e85d96af78dc | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 36.177134 | 84 | 0.568904 |
from collections import defaultdict
from collections import namedtuple
import os
import uuid
import xml.etree.ElementTree as ET
from sushy_tools.emulator import constants
from sushy_tools.emulator import memoize
from sushy_tools.emulator.resources.systems.base import AbstractSystemsDriver
from sushy_tools import erro... | true | true |
1c15f874a2cba185021ef565ef2a87bd1070fbc4 | 6,171 | py | Python | hic2structure/hic.py | 4DGB/3DStructure | f282c525a686ae6abb6407809ebedb384cf3226d | [
"BSD-3-Clause"
] | null | null | null | hic2structure/hic.py | 4DGB/3DStructure | f282c525a686ae6abb6407809ebedb384cf3226d | [
"BSD-3-Clause"
] | null | null | null | hic2structure/hic.py | 4DGB/3DStructure | f282c525a686ae6abb6407809ebedb384cf3226d | [
"BSD-3-Clause"
] | null | null | null | from io import BufferedReader
from pathlib import Path
import struct
import numpy as np
from hicstraw import straw
from .types import ContactRecordSettings, ContactRecords
"""
Module for dealing with Hi-C data files
"""
def _readcstr(f):
"""
Helper function for reading in C-style string from file
"""
... | 31.01005 | 99 | 0.549992 | from io import BufferedReader
from pathlib import Path
import struct
import numpy as np
from hicstraw import straw
from .types import ContactRecordSettings, ContactRecords
def _readcstr(f):
buf = b""
while True:
b = f.read(1)
if b is None or b == b"\0":
return buf.decode("utf-8")... | true | true |
1c15f8a39b7fc24a9b13ef30782f189881fcbd07 | 981 | py | Python | Python/ConstructiveAlgorithms/GamingArray/GamingArray.py | zseen/hackerrank-challenges | c154f039f58073ee3d94d012462c7055e68784b2 | [
"MIT"
] | null | null | null | Python/ConstructiveAlgorithms/GamingArray/GamingArray.py | zseen/hackerrank-challenges | c154f039f58073ee3d94d012462c7055e68784b2 | [
"MIT"
] | null | null | null | Python/ConstructiveAlgorithms/GamingArray/GamingArray.py | zseen/hackerrank-challenges | c154f039f58073ee3d94d012462c7055e68784b2 | [
"MIT"
] | null | null | null | import math
import os
import random
import re
import sys
LOCAL_INPUT = False
def takeTurnsGetWinner(listOfNums):
maxItem = listOfNums[0]
countTurns = 1
for i in range(1, len(listOfNums)):
if listOfNums[i] > maxItem:
maxItem = listOfNums[i]
countTurns += 1
if countTu... | 20.020408 | 58 | 0.58002 | import math
import os
import random
import re
import sys
LOCAL_INPUT = False
def takeTurnsGetWinner(listOfNums):
maxItem = listOfNums[0]
countTurns = 1
for i in range(1, len(listOfNums)):
if listOfNums[i] > maxItem:
maxItem = listOfNums[i]
countTurns += 1
if countTu... | true | true |
1c15f9feb9d25621ed761711e93ab65d6de4a67e | 4,730 | py | Python | augur/datasources/githubapi/routes.py | Szong06/augur | 9ceac23dd08d00d27f50ed5ef6320a05790a0a51 | [
"MIT"
] | 3 | 2019-03-15T20:37:37.000Z | 2019-03-15T22:09:16.000Z | augur/datasources/githubapi/routes.py | Szong06/augur | 9ceac23dd08d00d27f50ed5ef6320a05790a0a51 | [
"MIT"
] | 16 | 2019-04-25T00:06:57.000Z | 2022-01-22T04:26:28.000Z | augur/datasources/githubapi/routes.py | Szong06/augur | 9ceac23dd08d00d27f50ed5ef6320a05790a0a51 | [
"MIT"
] | 3 | 2019-04-12T20:34:35.000Z | 2019-04-14T19:06:25.000Z | #SPDX-License-Identifier: MIT
"""
Creates routes for the GitHub API data source plugin
"""
def create_routes(server):
github = server._augur['githubapi']()
#####################################
### DIVERSITY AND INCLUSION ###
#####################################
##########################... | 38.770492 | 214 | 0.448203 |
def create_routes(server):
github = server._augur['githubapi']()
server.addMetric(github.lines_of_code_changed, 'lines_changed')
server.addMetric(github.bus_factor, "bus_factor")
server.addTimeseries(github.major_tags, 't... | true | true |
1c15fa12ec1611b852427f2753853db09eea6fd0 | 630 | py | Python | Data Types and Variables/gladiator_expenses.py | elipopovadev/SoftUni-Python-Fundamentals | 540835ca35f0d7d2d24033aa9b6d7e173188e587 | [
"MIT"
] | null | null | null | Data Types and Variables/gladiator_expenses.py | elipopovadev/SoftUni-Python-Fundamentals | 540835ca35f0d7d2d24033aa9b6d7e173188e587 | [
"MIT"
] | null | null | null | Data Types and Variables/gladiator_expenses.py | elipopovadev/SoftUni-Python-Fundamentals | 540835ca35f0d7d2d24033aa9b6d7e173188e587 | [
"MIT"
] | null | null | null | fights_count = int(input())
helmet_price = float(input())
sword_price = float(input())
shield_price = float(input())
armor_price = float(input())
count_times_shield_break = 0
total_cost = 0
for i in range(1, fights_count + 1):
if i % 2 == 0:
total_cost += helmet_price
if i % 3 == 0:
total_cost ... | 28.636364 | 53 | 0.622222 | fights_count = int(input())
helmet_price = float(input())
sword_price = float(input())
shield_price = float(input())
armor_price = float(input())
count_times_shield_break = 0
total_cost = 0
for i in range(1, fights_count + 1):
if i % 2 == 0:
total_cost += helmet_price
if i % 3 == 0:
total_cost ... | true | true |
1c15fa3ea1a1910a39caf3be0226ab6905345c36 | 15,074 | py | Python | src/sentry/utils/pytest/selenium.py | overquota/sentry | 2cb3a3e40ca0b7ca3308deb0d1d9c436ce8aaeb8 | [
"BSD-3-Clause"
] | 1 | 2019-08-28T11:03:13.000Z | 2019-08-28T11:03:13.000Z | src/sentry/utils/pytest/selenium.py | overquota/sentry | 2cb3a3e40ca0b7ca3308deb0d1d9c436ce8aaeb8 | [
"BSD-3-Clause"
] | 1 | 2022-01-15T02:36:18.000Z | 2022-01-15T02:36:18.000Z | src/sentry/utils/pytest/selenium.py | gaybro8777/sentry | 4594f479db9a079d7f1ed41a9e07d8f36953319f | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
# TODO(dcramer): this heavily inspired by pytest-selenium, and it's possible
# we could simply inherit from the plugin at this point
import logging
import os
import pytest
from datetime import datetime
from django.conf import settings
from selenium import webdriver
from seleniu... | 34.104072 | 131 | 0.636195 | from __future__ import absolute_import
# we could simply inherit from the plugin at this point
import logging
import os
import pytest
from datetime import datetime
from django.conf import settings
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.sup... | true | true |
1c15fcecbba9fe41ae060f69b36f2f9c9a672909 | 284 | py | Python | molecule/default/tests/test_default.py | ibuchanan/ansible-aria2 | 136fb8ef4a4eef49b7744a36d2a6dd2346ea5f38 | [
"MIT"
] | null | null | null | molecule/default/tests/test_default.py | ibuchanan/ansible-aria2 | 136fb8ef4a4eef49b7744a36d2a6dd2346ea5f38 | [
"MIT"
] | null | null | null | molecule/default/tests/test_default.py | ibuchanan/ansible-aria2 | 136fb8ef4a4eef49b7744a36d2a6dd2346ea5f38 | [
"MIT"
] | null | null | null | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_aria2c_exists(host):
assert host.exists('aria2c')
assert host.run_test('aria2c --version')
| 23.666667 | 63 | 0.774648 | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_aria2c_exists(host):
assert host.exists('aria2c')
assert host.run_test('aria2c --version')
| true | true |
1c15fd4eed9557a7866a22680e8f03270cbc0a57 | 9,903 | py | Python | tests/runner/test_string_manipulations.py | OasisLMF/OEDtransform | 688a9cf90a7f11ee19f5f48fcbe1cb93962ea67d | [
"BSD-3-Clause"
] | 1 | 2022-03-18T14:53:27.000Z | 2022-03-18T14:53:27.000Z | tests/runner/test_string_manipulations.py | OasisLMF/OpenDataTransform | 688a9cf90a7f11ee19f5f48fcbe1cb93962ea67d | [
"BSD-3-Clause"
] | 25 | 2021-08-05T16:17:24.000Z | 2022-03-29T16:28:35.000Z | tests/runner/test_string_manipulations.py | OasisLMF/OEDtransform | 688a9cf90a7f11ee19f5f48fcbe1cb93962ea67d | [
"BSD-3-Clause"
] | 1 | 2022-01-21T14:39:20.000Z | 2022-01-21T14:39:20.000Z | from hypothesis import given, settings
from converter.config import Config
from converter.mapping.base import ColumnConversion, TransformationEntry
from converter.types.notset import NotSet
from ..connector.fakes import FakeConnector
from ..mapping.fakes import make_simple_mapping
from .stategies import runners
@gi... | 25.789063 | 76 | 0.44017 | from hypothesis import given, settings
from converter.config import Config
from converter.mapping.base import ColumnConversion, TransformationEntry
from converter.types.notset import NotSet
from ..connector.fakes import FakeConnector
from ..mapping.fakes import make_simple_mapping
from .stategies import runners
@gi... | true | true |
1c15fd52c5048b7a0d0527cc4c79af0e123daaed | 20,937 | py | Python | Train_PFNet.py | GuilinZ/PF-Net-Point-Fractal-Network | 80322cc2fb330c9820eb8540de75ca28e3fe64c4 | [
"MIT"
] | null | null | null | Train_PFNet.py | GuilinZ/PF-Net-Point-Fractal-Network | 80322cc2fb330c9820eb8540de75ca28e3fe64c4 | [
"MIT"
] | null | null | null | Train_PFNet.py | GuilinZ/PF-Net-Point-Fractal-Network | 80322cc2fb330c9820eb8540de75ca28e3fe64c4 | [
"MIT"
] | null | null | null | import os
import sys
import argparse
import random
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.utils.data
import torchvision.transforms as transforms
from torch.autograd import Variable
import utils
from utils import PointLoss
from utils import distance_squre
import data_util... | 49.968974 | 185 | 0.603859 | import os
import sys
import argparse
import random
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.utils.data
import torchvision.transforms as transforms
from torch.autograd import Variable
import utils
from utils import PointLoss
from utils import distance_squre
import data_util... | true | true |
1c15fdcf86ad1a3e29deb92ab303de62af01e11d | 14,968 | py | Python | tests/unit/gapic/v1/test_cluster_controller_client_v1.py | vam-google/python-dataproc | 53b0c6b32fedb6a867398fa2ad776d43238aa602 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/v1/test_cluster_controller_client_v1.py | vam-google/python-dataproc | 53b0c6b32fedb6a867398fa2ad776d43238aa602 | [
"Apache-2.0"
] | 40 | 2019-07-16T10:04:48.000Z | 2020-01-20T09:04:59.000Z | tests/unit/gapic/v1/test_cluster_controller_client_v1.py | vam-google/python-dataproc | 53b0c6b32fedb6a867398fa2ad776d43238aa602 | [
"Apache-2.0"
] | 2 | 2019-07-18T00:05:31.000Z | 2019-11-27T14:17:22.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 36.154589 | 87 | 0.665019 |
import mock
import pytest
from google.rpc import status_pb2
from google.cloud import dataproc_v1
from google.cloud.dataproc_v1.proto import clusters_pb2
from google.longrunning import operations_pb2
from google.protobuf import empty_pb2
from google.protobuf import field_mask_pb2
class MultiCallableStub(object):
... | true | true |
1c15ff9933f4b281ac443fdf357f1d0133220925 | 268 | py | Python | src/UQpy/dimension_reduction/grassmann_manifold/__init__.py | SURGroup/UncertaintyQuantification | a94c8db47d07134ea2b3b0a3ca53ca818532c3e6 | [
"MIT"
] | null | null | null | src/UQpy/dimension_reduction/grassmann_manifold/__init__.py | SURGroup/UncertaintyQuantification | a94c8db47d07134ea2b3b0a3ca53ca818532c3e6 | [
"MIT"
] | null | null | null | src/UQpy/dimension_reduction/grassmann_manifold/__init__.py | SURGroup/UncertaintyQuantification | a94c8db47d07134ea2b3b0a3ca53ca818532c3e6 | [
"MIT"
] | null | null | null | from UQpy.dimension_reduction.grassmann_manifold.GrassmannOperations import GrassmannOperations
from UQpy.dimension_reduction.grassmann_manifold.GrassmannInterpolation import GrassmannInterpolation
from UQpy.dimension_reduction.grassmann_manifold.projections import *
| 67 | 101 | 0.91791 | from UQpy.dimension_reduction.grassmann_manifold.GrassmannOperations import GrassmannOperations
from UQpy.dimension_reduction.grassmann_manifold.GrassmannInterpolation import GrassmannInterpolation
from UQpy.dimension_reduction.grassmann_manifold.projections import *
| true | true |
1c1600fa1b50321fce093d01ff211af94ae7fcee | 468 | py | Python | bildungslogin-plugin/tests/unittests/test_plugin.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | bildungslogin-plugin/tests/unittests/test_plugin.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | bildungslogin-plugin/tests/unittests/test_plugin.py | univention/bildungslogin | 29bebe858a5445dd5566aad594b33b9dd716eca4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from unittest.mock import patch
import pytest
import bildungslogin_plugin.plugin
from bildungslogin_plugin.backend_udm_rest_api import UdmRestApiBackend
from bildungslogin_plugin.routes.v1.users import get_backend
@patch("bildungslogin_plugin.plugin.ldap_auth")
@pytest.mark.asyncio
async de... | 26 | 71 | 0.811966 |
from unittest.mock import patch
import pytest
import bildungslogin_plugin.plugin
from bildungslogin_plugin.backend_udm_rest_api import UdmRestApiBackend
from bildungslogin_plugin.routes.v1.users import get_backend
@patch("bildungslogin_plugin.plugin.ldap_auth")
@pytest.mark.asyncio
async def test_setup(ldap_auth_m... | true | true |
1c160143892996914c2aa479087a9ababc3e9190 | 460 | py | Python | tests/test_tig.py | coint-hub/transparent-image-generator | 553ccb329d2a68f3c72db30d6b21cc3ff92ca696 | [
"MIT"
] | null | null | null | tests/test_tig.py | coint-hub/transparent-image-generator | 553ccb329d2a68f3c72db30d6b21cc3ff92ca696 | [
"MIT"
] | 1 | 2020-02-05T08:50:00.000Z | 2020-02-05T08:50:00.000Z | tests/test_tig.py | coint-hub/transparent-image-generator | 553ccb329d2a68f3c72db30d6b21cc3ff92ca696 | [
"MIT"
] | null | null | null | import os
from transparent_image_generator import tig, tig_data_url
def test_tig():
with open(os.path.join(os.path.dirname(__file__), '1x1.png'), 'rb') as f:
assert f.read() == tig(1, 1)
def test_tig_data_url():
assert 'data:image/png;base64,' \
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl2... | 28.75 | 88 | 0.691304 | import os
from transparent_image_generator import tig, tig_data_url
def test_tig():
with open(os.path.join(os.path.dirname(__file__), '1x1.png'), 'rb') as f:
assert f.read() == tig(1, 1)
def test_tig_data_url():
assert 'data:image/png;base64,' \
'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl2... | true | true |
1c1602b0131ea2afee87a36dea011e40322d105c | 46,040 | py | Python | lldb/examples/python/crashlog.py | tiwaria1/llvm | 616a396db0610ae0c1992361af005a869ef81897 | [
"Apache-2.0"
] | 27 | 2020-02-18T20:48:54.000Z | 2022-02-14T01:30:00.000Z | lldb/examples/python/crashlog.py | coolstar/llvm-project | e21ccdd5b5667de50de65ee8903a89a21020e89a | [
"Apache-2.0"
] | 3 | 2020-02-14T10:43:01.000Z | 2022-02-05T22:55:07.000Z | lldb/examples/python/crashlog.py | coolstar/llvm-project | e21ccdd5b5667de50de65ee8903a89a21020e89a | [
"Apache-2.0"
] | 7 | 2020-04-14T09:12:18.000Z | 2021-09-20T10:31:12.000Z | #!/usr/bin/python
#----------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
#
# To use this in the embedded python interpreter using "lldb":
#
# cd /path/containing/crashlog.py
# lldb
# (lldb) script import crashlog
# "crash... | 43.028037 | 185 | 0.528649 |
from __future__ import print_function
import cmd
import datetime
import glob
import optparse
import os
import platform
import plistlib
import pprint import re
import shlex
import string
import subprocess
import sys
import time
import uuid
def read_plist(s):
if sys.version_info.major == 3:
return plistli... | true | true |
1c16031caafc6e2b02f2a4368bd7cabd8fb9be55 | 11,168 | py | Python | data/modules/graphic/two_D/player_gui/container.py | Sheidaas/gamee | 434db4648e1719a648b8784f201b03b4c8e243c3 | [
"CC-BY-3.0"
] | null | null | null | data/modules/graphic/two_D/player_gui/container.py | Sheidaas/gamee | 434db4648e1719a648b8784f201b03b4c8e243c3 | [
"CC-BY-3.0"
] | null | null | null | data/modules/graphic/two_D/player_gui/container.py | Sheidaas/gamee | 434db4648e1719a648b8784f201b03b4c8e243c3 | [
"CC-BY-3.0"
] | null | null | null | import pygame
from data.modules.graphic.two_D import button
from .gui_abstract_object import GuiAbstractObject
class Containter(GuiAbstractObject):
def __init__(self, container, screen):
self.position = screen.game.drawer.gui['container']['last_position']
self.screen = screen
self.contain... | 51.229358 | 209 | 0.586587 | import pygame
from data.modules.graphic.two_D import button
from .gui_abstract_object import GuiAbstractObject
class Containter(GuiAbstractObject):
def __init__(self, container, screen):
self.position = screen.game.drawer.gui['container']['last_position']
self.screen = screen
self.contain... | true | true |
1c16035d7d5c01a40bc92ce9ad424154426df0ae | 918 | py | Python | src/handlers/newcommenthandler.py | kevinbaijnath/MultiUserBlog | 20d0caf4b4d48c710a2dcda866ab855c602081cc | [
"MIT"
] | null | null | null | src/handlers/newcommenthandler.py | kevinbaijnath/MultiUserBlog | 20d0caf4b4d48c710a2dcda866ab855c602081cc | [
"MIT"
] | null | null | null | src/handlers/newcommenthandler.py | kevinbaijnath/MultiUserBlog | 20d0caf4b4d48c710a2dcda866ab855c602081cc | [
"MIT"
] | null | null | null | from ..constants import BLOG_KEY, COMMENT_KEY
from ..handlers.bloghandler import BlogHandler
from ..helpers.decorators import logged_in, blogpost_exists
from ..models.blogpost import BlogPost
from ..models.comment import Comment
class NewCommentHandler(BlogHandler):
"""Defines the New Comment functionality"""
... | 36.72 | 69 | 0.655773 | from ..constants import BLOG_KEY, COMMENT_KEY
from ..handlers.bloghandler import BlogHandler
from ..helpers.decorators import logged_in, blogpost_exists
from ..models.blogpost import BlogPost
from ..models.comment import Comment
class NewCommentHandler(BlogHandler):
@logged_in
@blogpost_exists
def post(s... | true | true |
1c1603d1abab233380508e0466aae61f575bb066 | 5,218 | py | Python | script/analysis/check_transformation_matrices.py | lanl/nubhlight | 6c0f2abc05884538fe8e4e2e70a021b7c48a72c2 | [
"BSD-3-Clause"
] | 16 | 2020-02-05T22:59:21.000Z | 2022-03-18T11:05:37.000Z | script/analysis/check_transformation_matrices.py | lanl/nubhlight | 6c0f2abc05884538fe8e4e2e70a021b7c48a72c2 | [
"BSD-3-Clause"
] | 13 | 2020-03-06T02:10:48.000Z | 2021-06-15T20:00:30.000Z | script/analysis/check_transformation_matrices.py | lanl/nubhlight | 6c0f2abc05884538fe8e4e2e70a021b7c48a72c2 | [
"BSD-3-Clause"
] | 4 | 2020-02-21T04:59:44.000Z | 2020-12-10T21:42:12.000Z | # ======================================================================
# copyright 2020. Triad National Security, LLC. All rights
# reserved. This program was produced under U.S. Government contract
# 89233218CNA000001 for Los Alamos National Laboratory (LANL), which
# is operated by Triad National Security, LLC for ... | 28.358696 | 77 | 0.593139 |
from math import *
import numpy as np
def print_matrix(matrix,fmt="%19.11e",tostdout=True) -> str:
N = matrix.shape[0]
M = matrix.shape[1]
s = "["
for i in range(N):
s+= "["
for j in range(M):
s+= (fmt % matrix[i,j])
if j < M - 1: s += ", "
s+= "]"
if i < N - 1: s += ",\n "
s+="... | true | true |
1c160417bf58e3417f52fc57ce699e7035effed2 | 3,805 | py | Python | tests/datastreams/test_dnszone.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | tests/datastreams/test_dnszone.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | tests/datastreams/test_dnszone.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# dnszone datastream test
# ----------------------------------------------------------------------
# Copyright (C) 2007-2018 The NOC Project
# See LICENSE for details
# ------------------------------------------------------... | 32.801724 | 94 | 0.418134 |
import pytest
from noc.services.datastream.streams.dnszone import DNSZoneDataStream
def find_record(records, name, type, content):
for r in records:
if r.get("name") == name and r.get("type") == type and r.get("rdata") == content:
return True
return False
@pytest.mark.parametrize(
... | true | true |
1c16042aaa47361a8c0adf99073c022361ac5369 | 25,171 | py | Python | villager-bot/cogs/commands/useful.py | Iapetus-11/Villager-Bot-Jr | 7a118fdce7cd2504c58c9f98a4c2ab34616dc420 | [
"MIT"
] | 3 | 2021-11-23T18:53:33.000Z | 2021-11-24T16:35:56.000Z | villager-bot/cogs/commands/useful.py | Iapetus-11/Villager-Bot-Jr | 7a118fdce7cd2504c58c9f98a4c2ab34616dc420 | [
"MIT"
] | null | null | null | villager-bot/cogs/commands/useful.py | Iapetus-11/Villager-Bot-Jr | 7a118fdce7cd2504c58c9f98a4c2ab34616dc420 | [
"MIT"
] | 1 | 2021-11-24T13:47:09.000Z | 2021-11-24T13:47:09.000Z | from urllib.parse import quote as urlquote
from discord.ext import commands, tasks
from contextlib import suppress
import async_cse
import asyncio
import discord
import psutil
import arrow
import time
from util.misc import SuppressCtxManager
from util.ipc import PacketType
class BanCacheEntry:
__slots__ = ("ban_... | 39.827532 | 128 | 0.584601 | from urllib.parse import quote as urlquote
from discord.ext import commands, tasks
from contextlib import suppress
import async_cse
import asyncio
import discord
import psutil
import arrow
import time
from util.misc import SuppressCtxManager
from util.ipc import PacketType
class BanCacheEntry:
__slots__ = ("ban_... | true | true |
1c16054347e5a7178ed00e32ee0452db2a7689f6 | 4,586 | py | Python | python45.py | onnela-lab/mech-mle | 8a36c1a75dbbc665feb642f527aeb09e7462e90b | [
"BSD-3-Clause"
] | null | null | null | python45.py | onnela-lab/mech-mle | 8a36c1a75dbbc665feb642f527aeb09e7462e90b | [
"BSD-3-Clause"
] | null | null | null | python45.py | onnela-lab/mech-mle | 8a36c1a75dbbc665feb642f527aeb09e7462e90b | [
"BSD-3-Clause"
] | null | null | null | # JP Onnela
# April 20, 2021
# Edited May 12, 2021 by Jonathan Larson
import networkx as nx
import random
import scipy.stats as ss
import time
def generate_DMC(q_mod, q_con, n):
"""Generate DMC model realization given parameters."""
G = nx.Graph()
G.add_edge(0,1)
new_nodes = list(range(... | 26.976471 | 93 | 0.557567 |
import networkx as nx
import random
import scipy.stats as ss
import time
def generate_DMC(q_mod, q_con, n):
G = nx.Graph()
G.add_edge(0,1)
new_nodes = list(range(2,n))
anchor_nodes = []
for v in new_nodes:
u = random.choice(list(G.nodes()))
anchor_nodes.append(u)
... | true | true |
1c160567cc01d1a92847d698fc59b06809606568 | 298 | py | Python | com/kranthi/Algorithms/Arrays/DynamicProgramingToFibonacci.py | kuldeep27396/DataStructuresandAlgorithmsInPython | 84e13a9a8a9802f7079bd8246f1c8386c231ca83 | [
"BSD-3-Clause"
] | null | null | null | com/kranthi/Algorithms/Arrays/DynamicProgramingToFibonacci.py | kuldeep27396/DataStructuresandAlgorithmsInPython | 84e13a9a8a9802f7079bd8246f1c8386c231ca83 | [
"BSD-3-Clause"
] | 1 | 2020-09-30T16:09:59.000Z | 2020-09-30T16:09:59.000Z | com/kranthi/Algorithms/Arrays/DynamicProgramingToFibonacci.py | kuldeep27396/DataStructuresandAlgorithmsInPython | 84e13a9a8a9802f7079bd8246f1c8386c231ca83 | [
"BSD-3-Clause"
] | 2 | 2020-09-30T14:18:47.000Z | 2021-09-30T16:07:27.000Z |
def fib_botton_up(n):
if n == 0 or n == 1:
return 1
bottom_up = [0, 1]
bottom_up.extend([0]*(n-1))
# bottom_up[0] = 0
# bottom_up[1] = 1
for i in range(2, n+1):
bottom_up[i] = bottom_up[i-1] + bottom_up[i-2]
return bottom_up
print(fib_botton_up(9))
| 17.529412 | 54 | 0.54698 |
def fib_botton_up(n):
if n == 0 or n == 1:
return 1
bottom_up = [0, 1]
bottom_up.extend([0]*(n-1))
for i in range(2, n+1):
bottom_up[i] = bottom_up[i-1] + bottom_up[i-2]
return bottom_up
print(fib_botton_up(9))
| true | true |
1c1605a7bc67df9f3a86e7857f9fc3cf021e2663 | 1,502 | py | Python | urls.py | kensonman/webframe | 45b5be33bb0341ab9658a05d577f82f0dd922c7e | [
"Apache-2.0"
] | 1 | 2017-04-22T11:29:05.000Z | 2017-04-22T11:29:05.000Z | urls.py | kensonman/webframe | 45b5be33bb0341ab9658a05d577f82f0dd922c7e | [
"Apache-2.0"
] | null | null | null | urls.py | kensonman/webframe | 45b5be33bb0341ab9658a05d577f82f0dd922c7e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
from django.conf import settings
from django.urls import path, re_path, include
from django.views.i18n import JavaScriptCatalog
from . import views
app_name='webframe'
urlpatterns=[
re_path(r'^login/?$', views.Login.as_view(), name='login'),
re_path(r'^logout/?$', views.logout, name='lo... | 48.451613 | 154 | 0.651132 | from django.conf import settings
from django.urls import path, re_path, include
from django.views.i18n import JavaScriptCatalog
from . import views
app_name='webframe'
urlpatterns=[
re_path(r'^login/?$', views.Login.as_view(), name='login'),
re_path(r'^logout/?$', views.logout, name='logout'),
re_path(r'^use... | true | true |
1c1608103b0e76ee7d04aeb38e80edabec18dbc3 | 2,635 | py | Python | demo_mortgage_payment_optimization.py | almostdutch/mortgage-payment-optimization | 9aeb9037ceb4383fe679f0e210bbfc06a828cee8 | [
"MIT"
] | null | null | null | demo_mortgage_payment_optimization.py | almostdutch/mortgage-payment-optimization | 9aeb9037ceb4383fe679f0e210bbfc06a828cee8 | [
"MIT"
] | null | null | null | demo_mortgage_payment_optimization.py | almostdutch/mortgage-payment-optimization | 9aeb9037ceb4383fe679f0e210bbfc06a828cee8 | [
"MIT"
] | null | null | null | """
demo_mortgage_payment_optimization.py
Numerical optimization to find the optimum way for the quickest reduction in the mortage debt \
while keeping the monthly payments as low as possible.
Set lambda1 and lambda2 according to your priorities.
mortgage_amount = initial mortgage amount
N_months = numbe... | 32.134146 | 113 | 0.705882 |
import numpy as np
import matplotlib.pyplot as plt
mortgage_amount = 200000;
interest = 2;
lambda1 = 1.0;
lambda2 = 2000.0;
N_months = 12 * 30;
fontsize = 24;
labelsize = 24;
temp1 = lambda1 * np.eye(N_months, N_months);
temp2 = np.zeros((N_months, N_months));
temp3 = np.zeros((N_months, N_months));
temp4 = lambda... | true | true |
1c1608a92e4c0a7c05649fcd34647e8ce1444578 | 1,034 | py | Python | curso/PY3/dicionarios/ex5.py | smrsassa/Studying-Python | a5acbce42b85bdd6aea8058ca323fbbd12ce5c22 | [
"MIT"
] | 1 | 2019-10-21T18:19:13.000Z | 2019-10-21T18:19:13.000Z | curso/PY3/dicionarios/ex5.py | smrsassa/Studying-python | a5acbce42b85bdd6aea8058ca323fbbd12ce5c22 | [
"MIT"
] | null | null | null | curso/PY3/dicionarios/ex5.py | smrsassa/Studying-python | a5acbce42b85bdd6aea8058ca323fbbd12ce5c22 | [
"MIT"
] | null | null | null | #exercicio 94
pessoa = list()
mulheres = list()
acimamedia = list()
grupo = dict()
c = totalidade = 0
while True:
c += 1
pessoa.append(str(input('Nome: ')))
sexo = str(input('sexo [M/F]: ')).strip().lower()
while True:
if sexo in 'mf':
pessoa.append(sexo)
break
e... | 28.722222 | 65 | 0.579304 | pessoa = list()
mulheres = list()
acimamedia = list()
grupo = dict()
c = totalidade = 0
while True:
c += 1
pessoa.append(str(input('Nome: ')))
sexo = str(input('sexo [M/F]: ')).strip().lower()
while True:
if sexo in 'mf':
pessoa.append(sexo)
break
else:
... | true | true |
1c1608e33ea893e7033e52df01ae99006149eade | 60,745 | py | Python | examples/retrain_ngraph.py | avijit-chakroborty/ngraph-bridge | b691d57412a40582ea93c6e564d80c750b7f2e8e | [
"Apache-2.0"
] | 142 | 2019-02-21T00:53:06.000Z | 2022-03-11T07:46:28.000Z | examples/retrain_ngraph.py | tensorflow/ngraph | ea6422491ec75504e78a63db029e7f74ec3479a5 | [
"Apache-2.0"
] | 252 | 2019-03-11T19:27:59.000Z | 2021-03-19T10:58:17.000Z | examples/retrain_ngraph.py | tensorflow/ngraph | ea6422491ec75504e78a63db029e7f74ec3479a5 | [
"Apache-2.0"
] | 65 | 2019-03-13T15:27:29.000Z | 2021-07-16T07:09:16.000Z | # Copyright 2015 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... | 43.08156 | 99 | 0.663478 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import collections
from datetime import datetime
import hashlib
import os.path
import random
import re
import sys
from subprocess import check_output, call
import shlex
import time
import nu... | true | true |
1c16090fdd4c94af08ab1106bb702b2b8be0b220 | 21,587 | py | Python | pyke/target_pkg.py | mvaled/pyke | cfe95d8aaa06de123264f9b7f5bea20eb5924ecd | [
"MIT"
] | 76 | 2015-04-20T12:10:25.000Z | 2021-11-27T20:26:27.000Z | pyke/target_pkg.py | w-simon/pyke | cfe95d8aaa06de123264f9b7f5bea20eb5924ecd | [
"MIT"
] | 2 | 2016-03-09T14:33:27.000Z | 2018-10-22T11:25:49.000Z | pyke/target_pkg.py | w-simon/pyke | cfe95d8aaa06de123264f9b7f5bea20eb5924ecd | [
"MIT"
] | 42 | 2015-03-16T13:11:30.000Z | 2022-02-12T14:45:48.000Z | # $Id$
# coding=utf-8
#
# Copyright © 2009 Bruce Frederiksen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, m... | 46.126068 | 80 | 0.549868 |
from __future__ import with_statement
import os, os.path
import time
import sys
import re
import pyke
debug = False
Name_test = re.compile(r'[a-zA-Z_][a-zA-Z0-9_]*$')
class target_pkg(object):
def __init__(self, module_name, filename = None,
pyke_version = pyke.version,
... | true | true |
1c1609fed1dd1ef194b7485ad1f3b8efd830dd83 | 89,806 | py | Python | pandas/indexes/multi.py | lorenzocestaro/pandas | a73e4518cf3d10fd239cdbd1be3bcda43443bf2a | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/indexes/multi.py | lorenzocestaro/pandas | a73e4518cf3d10fd239cdbd1be3bcda43443bf2a | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/indexes/multi.py | lorenzocestaro/pandas | a73e4518cf3d10fd239cdbd1be3bcda43443bf2a | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null |
# pylint: disable=E1101,E1103,W0232
import datetime
import warnings
from functools import partial
from sys import getsizeof
import numpy as np
from pandas._libs import index as libindex, lib, Timestamp
from pandas.compat import range, zip, lrange, lzip, map
from pandas.compat.numpy import function as nv
from pandas ... | 35.693959 | 79 | 0.536957 |
import datetime
import warnings
from functools import partial
from sys import getsizeof
import numpy as np
from pandas._libs import index as libindex, lib, Timestamp
from pandas.compat import range, zip, lrange, lzip, map
from pandas.compat.numpy import function as nv
from pandas import compat
from pandas.types.com... | true | true |
1c160ae1de2741becfb742a26ceaf81da30d122c | 2,503 | py | Python | django_site/users/migrations/0001_initial.py | StGrail/v.it | 765cb720a16b0fff66e013b8b66a80d99168c16b | [
"MIT"
] | null | null | null | django_site/users/migrations/0001_initial.py | StGrail/v.it | 765cb720a16b0fff66e013b8b66a80d99168c16b | [
"MIT"
] | 1 | 2020-12-23T19:08:20.000Z | 2020-12-23T19:08:20.000Z | django_site/users/migrations/0001_initial.py | StGrail/v.it | 765cb720a16b0fff66e013b8b66a80d99168c16b | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-09 13:24
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
... | 64.179487 | 266 | 0.651618 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
... | true | true |
1c160aea97d78b2613e52a0c516fbf2b57fbcba7 | 10,858 | py | Python | akshare/index/index_zh_em.py | lialzm/akshare | 5bc7f0ddcb540f4290c37a89b23feba3fceddf18 | [
"MIT"
] | null | null | null | akshare/index/index_zh_em.py | lialzm/akshare | 5bc7f0ddcb540f4290c37a89b23feba3fceddf18 | [
"MIT"
] | null | null | null | akshare/index/index_zh_em.py | lialzm/akshare | 5bc7f0ddcb540f4290c37a89b23feba3fceddf18 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2022/2/2 23:26
Desc: 东方财富网-行情首页-沪深京 A 股
"""
import requests
import pandas as pd
def index_code_id_map_em() -> dict:
"""
东方财富-股票和市场代码
http://quote.eastmoney.com/center/gridlist.html#hs_a_board
:return: 股票和市场代码
:rtype: dict
"""
url = "ht... | 31.748538 | 85 | 0.497974 | import requests
import pandas as pd
def index_code_id_map_em() -> dict:
url = "http://80.push2.eastmoney.com/api/qt/clist/get"
params = {
"pn": "1",
"pz": "5000",
"po": "1",
"np": "1",
"ut": "bd1d9ddb04089700cf9c27f6f7426281",
"fltt": "2",
"invt": "2",
... | true | true |
1c160b1141bab3dfc6d2501738e9ccdd68cbb9fc | 13,346 | py | Python | cosmos-db-migration-utility/src/lambda/batch-request-reader/lambda_function.py | N-Turner/amazon-documentdb-tools | 6efecd4837d80887d9c09f135c248a9ef407b82d | [
"Apache-2.0"
] | null | null | null | cosmos-db-migration-utility/src/lambda/batch-request-reader/lambda_function.py | N-Turner/amazon-documentdb-tools | 6efecd4837d80887d9c09f135c248a9ef407b82d | [
"Apache-2.0"
] | null | null | null | cosmos-db-migration-utility/src/lambda/batch-request-reader/lambda_function.py | N-Turner/amazon-documentdb-tools | 6efecd4837d80887d9c09f135c248a9ef407b82d | [
"Apache-2.0"
] | null | null | null | import logging
import os
import json
import traceback
from datetime import datetime
import copy
import boto3
import tempfile
import dateutil.parser
import copy
from random import randint
from bson.json_util import loads, dumps
from decimal import Decimal
from boto3.dynamodb.conditions import Key, Attr
from pymongo imp... | 47.664286 | 205 | 0.679155 | import logging
import os
import json
import traceback
from datetime import datetime
import copy
import boto3
import tempfile
import dateutil.parser
import copy
from random import randint
from bson.json_util import loads, dumps
from decimal import Decimal
from boto3.dynamodb.conditions import Key, Attr
from pymongo imp... | true | true |
1c160ba56fa366a305315b3d583c578a2f5e3b43 | 11,315 | py | Python | elevenclock/lang/lang_vi.py | mfpx/ElevenClock | 9a7dec3654b94c97fffe10f91d8669645413852c | [
"Apache-2.0"
] | null | null | null | elevenclock/lang/lang_vi.py | mfpx/ElevenClock | 9a7dec3654b94c97fffe10f91d8669645413852c | [
"Apache-2.0"
] | null | null | null | elevenclock/lang/lang_vi.py | mfpx/ElevenClock | 9a7dec3654b94c97fffe10f91d8669645413852c | [
"Apache-2.0"
] | null | null | null | # INSTRUCTIONS
# Translate the text and write it between the "
# EXAMPLE: original -> "This text is in english: value {0}"
# translation -> "Aquest text està en anglès: valor {0}"
# If you see sth like {0}, {1}, maintain it on the translated sentence
# Meke special attention to elements like "... | 48.562232 | 209 | 0.571365 |
# EXAMPLE: original -> "This text is in english: value {0}"
# translation -> "Aquest text està en anglès: valor {0}"
# If you see sth like {0}, {1}, maintain it on the translated sentence
# Meke special attention to elements like ":", etc.
lang_3_3_1 = {
"Invalid time format\nPlease follo... | true | true |
1c160c174fd539ab2f768e90c4f0a441ee35ae71 | 23,949 | py | Python | tests/unit/test_collator.py | Crunch-io/crunch-cube | 80986d5b2106c774f05176fb6c6a5ea0d840f09d | [
"MIT"
] | 3 | 2021-01-22T20:42:31.000Z | 2021-06-02T17:53:19.000Z | tests/unit/test_collator.py | Crunch-io/crunch-cube | 80986d5b2106c774f05176fb6c6a5ea0d840f09d | [
"MIT"
] | 331 | 2017-11-13T22:41:56.000Z | 2021-12-02T21:59:43.000Z | tests/unit/test_collator.py | Crunch-io/crunch-cube | 80986d5b2106c774f05176fb6c6a5ea0d840f09d | [
"MIT"
] | 1 | 2021-02-19T02:49:00.000Z | 2021-02-19T02:49:00.000Z | # encoding: utf-8
"""Unit test suite for `cr.cube.collator` module."""
import sys
import numpy as np
import pytest
from cr.cube.collator import (
_BaseAnchoredCollator,
_BaseCollator,
ExplicitOrderCollator,
PayloadOrderCollator,
SortByValueCollator,
)
from cr.cube.dimension import Dimension, _El... | 35.167401 | 88 | 0.571297 |
import sys
import numpy as np
import pytest
from cr.cube.collator import (
_BaseAnchoredCollator,
_BaseCollator,
ExplicitOrderCollator,
PayloadOrderCollator,
SortByValueCollator,
)
from cr.cube.dimension import Dimension, _Element, _OrderSpec, _Subtotal, _ValidElements
from ..unitutil import (
... | true | true |
1c160cc7a87b238eff17035e627176ade297bb7c | 1,702 | py | Python | samples/generated_samples/dialogflow_v2_generated_conversation_profiles_update_conversation_profile_sync.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | 171 | 2018-09-19T21:16:18.000Z | 2020-12-07T17:41:10.000Z | samples/generated_samples/dialogflow_v2_generated_conversation_profiles_update_conversation_profile_sync.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | 150 | 2018-09-25T14:04:28.000Z | 2020-12-09T21:45:43.000Z | samples/generated_samples/dialogflow_v2_generated_conversation_profiles_update_conversation_profile_sync.py | rkdfc93/python-dialogflow | a59cff0298ef18674c0b4133ef0a6ab82e288920 | [
"Apache-2.0"
] | 75 | 2018-09-22T14:12:18.000Z | 2020-12-08T07:12:12.000Z | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 34.734694 | 85 | 0.782609 |
from google.cloud import dialogflow_v2
def sample_update_conversation_profile():
client = dialogflow_v2.ConversationProfilesClient()
conversation_profile = dialogflow_v2.ConversationProfile()
conversation_profile.display_name = "display_name_value"
request = dialogflow_v2.UpdateConversati... | true | true |
1c160d82f98ffdfb7e45a71777ad1c4705fc307e | 4,623 | py | Python | 11_Time_Perception.py | Brinks0211/cognitive_paradigms_patients_data_analysis | c9a231cb5e1ec321f11b99a3bacb0ed80b2c4bac | [
"MIT"
] | null | null | null | 11_Time_Perception.py | Brinks0211/cognitive_paradigms_patients_data_analysis | c9a231cb5e1ec321f11b99a3bacb0ed80b2c4bac | [
"MIT"
] | null | null | null | 11_Time_Perception.py | Brinks0211/cognitive_paradigms_patients_data_analysis | c9a231cb5e1ec321f11b99a3bacb0ed80b2c4bac | [
"MIT"
] | null | null | null | import csv
import numpy
import tkinter as tk
from tkinter.filedialog import askopenfilename
reacttime = []
corratio = []
Standard_Deviation = []
# GUI
root = tk.Tk()
root.wm_title("11_Time_Perception")
root.geometry("700x200")
path=tk.StringVar()
w0=tk.Label(root, text='11_Time_Perception',width=40)
w0.p... | 31.026846 | 104 | 0.598529 | import csv
import numpy
import tkinter as tk
from tkinter.filedialog import askopenfilename
reacttime = []
corratio = []
Standard_Deviation = []
root = tk.Tk()
root.wm_title("11_Time_Perception")
root.geometry("700x200")
path=tk.StringVar()
w0=tk.Label(root, text='11_Time_Perception',width=40)
w0.place(x=... | true | true |
1c160efa9554e8fe0dbb73ea2571a175bddefc95 | 4,686 | py | Python | openstack_plugin/tasks/floating_ip.py | aiorchestra/aiorchestra-openstack-plugin | d44dd0a2744a857cda243dfb5fe7d314949a5dc4 | [
"Apache-2.0"
] | 5 | 2016-06-22T20:08:31.000Z | 2021-08-30T11:40:11.000Z | openstack_plugin/tasks/floating_ip.py | aiorchestra/aiorchestra-openstack-plugin | d44dd0a2744a857cda243dfb5fe7d314949a5dc4 | [
"Apache-2.0"
] | 61 | 2016-06-23T11:49:08.000Z | 2016-07-13T10:03:51.000Z | openstack_plugin/tasks/floating_ip.py | aiorchestra/aiorchestra-openstack-plugin | d44dd0a2744a857cda243dfb5fe7d314949a5dc4 | [
"Apache-2.0"
] | 1 | 2016-06-22T20:08:32.000Z | 2016-06-22T20:08:32.000Z | # Author: Denys Makogon
#
# 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 t... | 36.609375 | 78 | 0.642339 |
from aiorchestra.core import utils
from openstack_plugin.common import clients
from openstack_plugin.networking import floating_ip
@utils.operation
async def floatingip_create(node, inputs):
node.context.logger.info(
'[{0}] - Attempting to create floating IP.'
.format(node.name))
existing_fl... | true | true |
1c160f7b7b5a60f288386896d76569f1c54b92e9 | 275 | py | Python | authentication/admin.py | sec-zone/vuln_app | 209976d8e4f44bd8cfbd227e1270cb7d9482b7cb | [
"Apache-2.0"
] | 1 | 2020-11-23T06:44:41.000Z | 2020-11-23T06:44:41.000Z | authentication/admin.py | sec-zone/vuln_app | 209976d8e4f44bd8cfbd227e1270cb7d9482b7cb | [
"Apache-2.0"
] | null | null | null | authentication/admin.py | sec-zone/vuln_app | 209976d8e4f44bd8cfbd227e1270cb7d9482b7cb | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import BlogUser, Email
class BlogUserFields(admin.ModelAdmin):
list_display = ('username', 'create_date', 'update_date')
# Register your models here.
admin.site.register(BlogUser, BlogUserFields)
admin.site.register(Email) | 27.5 | 61 | 0.785455 | from django.contrib import admin
from .models import BlogUser, Email
class BlogUserFields(admin.ModelAdmin):
list_display = ('username', 'create_date', 'update_date')
admin.site.register(BlogUser, BlogUserFields)
admin.site.register(Email) | true | true |
1c16118e19f907d4d116087e5deae8d97b313386 | 17,402 | py | Python | quamash/__init__.py | ashleysommer/quamash | e513b30f137415c5e098602fa383e45debab85e7 | [
"BSD-2-Clause"
] | 260 | 2015-01-05T15:39:57.000Z | 2022-02-25T09:29:44.000Z | quamash/__init__.py | ashleysommer/quamash | e513b30f137415c5e098602fa383e45debab85e7 | [
"BSD-2-Clause"
] | 105 | 2015-01-05T15:39:11.000Z | 2022-03-21T10:59:28.000Z | quamash/__init__.py | ashleysommer/quamash | e513b30f137415c5e098602fa383e45debab85e7 | [
"BSD-2-Clause"
] | 62 | 2015-01-17T21:13:44.000Z | 2022-03-21T11:15:15.000Z | # © 2014 Mark Harviston <mark.harviston@gmail.com>
# © 2014 Arve Knudsen <arve.knudsen@gmail.com>
# BSD License
"""Implementation of the PEP 3156 Event-Loop with Qt."""
__author__ = 'Mark Harviston <mark.harviston@gmail.com>, Arve Knudsen <arve.knudsen@gmail.com>'
__version__ = '0.6.1'
__url__ = 'https://github.com/ha... | 28.434641 | 105 | 0.71917 |
__author__ = 'Mark Harviston <mark.harviston@gmail.com>, Arve Knudsen <arve.knudsen@gmail.com>'
__version__ = '0.6.1'
__url__ = 'https://github.com/harvimt/quamash'
__license__ = 'BSD'
__all__ = ['QEventLoop', 'QThreadExecutor']
import sys
import os
import asyncio
import time
import itertools
from queue import Queue
... | true | true |
1c1611cc17385e2f19dc6f551dc381712c781b60 | 2,940 | py | Python | fc2/auth.py | xuzizhou/fc-python-sdk | 3964dc91de69263083ef62ab4b13b21c6fe4fc58 | [
"MIT"
] | 51 | 2017-08-02T01:35:03.000Z | 2022-03-13T07:07:15.000Z | fc2/auth.py | xuzizhou/fc-python-sdk | 3964dc91de69263083ef62ab4b13b21c6fe4fc58 | [
"MIT"
] | 61 | 2017-08-26T03:37:26.000Z | 2022-01-23T21:20:56.000Z | fc2/auth.py | xuzizhou/fc-python-sdk | 3964dc91de69263083ef62ab4b13b21c6fe4fc58 | [
"MIT"
] | 16 | 2017-09-27T07:58:19.000Z | 2021-11-12T03:21:20.000Z | # -*- coding: utf-8 -*-
import requests
import hashlib
import hmac
import base64
import logging
class Auth(object):
def __init__(self, access_key_id, access_key_secret, security_token=""):
self.id = access_key_id.strip()
self.secret = access_key_secret.strip()
self.security_token = securit... | 36.75 | 102 | 0.607143 |
import requests
import hashlib
import hmac
import base64
import logging
class Auth(object):
def __init__(self, access_key_id, access_key_secret, security_token=""):
self.id = access_key_id.strip()
self.secret = access_key_secret.strip()
self.security_token = security_token.strip()
def... | true | true |
1c1613796ce6aeea82f567200f1dd6f048b7afe9 | 1,705 | py | Python | src/inspetor/model/inspetor_abstract_model.py | legiti/inspetor-python | 1f74b4abf421dca248246a9df91176aff762ac7b | [
"MIT"
] | 1 | 2019-12-10T20:37:58.000Z | 2019-12-10T20:37:58.000Z | src/inspetor/model/inspetor_abstract_model.py | inspetor/inspetor-python | 1f74b4abf421dca248246a9df91176aff762ac7b | [
"MIT"
] | 1 | 2019-11-06T20:42:51.000Z | 2019-11-06T20:42:51.000Z | src/inspetor/model/inspetor_abstract_model.py | inspetor/inspetor-python | 1f74b4abf421dca248246a9df91176aff762ac7b | [
"MIT"
] | null | null | null | import base64
import string
from datetime import datetime
from src.inspetor.exception.model_exception.inspetor_general_exception import InspetorGeneralException
class InspetorAbstractModel(object):
def encode_array(self, array, isObject):
encoded_array = []
if array is None:
return No... | 33.431373 | 121 | 0.642229 | import base64
import string
from datetime import datetime
from src.inspetor.exception.model_exception.inspetor_general_exception import InspetorGeneralException
class InspetorAbstractModel(object):
def encode_array(self, array, isObject):
encoded_array = []
if array is None:
return No... | true | true |
1c1614321962eb5a1c4c480a37ae051ab16d7a8c | 37,961 | py | Python | zerver/worker/queue_processors.py | pranjalg13/zulip | b894dc0fe02eabf6990b15755a827debb15e3575 | [
"Apache-2.0"
] | 1 | 2020-09-19T09:18:39.000Z | 2020-09-19T09:18:39.000Z | zerver/worker/queue_processors.py | pranjalg13/zulip | b894dc0fe02eabf6990b15755a827debb15e3575 | [
"Apache-2.0"
] | null | null | null | zerver/worker/queue_processors.py | pranjalg13/zulip | b894dc0fe02eabf6990b15755a827debb15e3575 | [
"Apache-2.0"
] | null | null | null | # Documented in https://zulip.readthedocs.io/en/latest/subsystems/queuing.html
import base64
import copy
import datetime
import email
import email.policy
import functools
import logging
import os
import signal
import smtplib
import socket
import tempfile
import time
import urllib
from abc import ABC, abstractmethod
fro... | 43.186576 | 133 | 0.650009 | import base64
import copy
import datetime
import email
import email.policy
import functools
import logging
import os
import signal
import smtplib
import socket
import tempfile
import time
import urllib
from abc import ABC, abstractmethod
from collections import defaultdict, deque
from email.message import EmailMessage
... | true | true |
1c161574257b3bed2468128a276014a72385b55a | 4,431 | py | Python | qirest_client/model/facade.py | ohsu-qin/qiprofile-rest-client | 0d4190854966f8bdb9ef40dc599358a620c99376 | [
"BSD-2-Clause"
] | null | null | null | qirest_client/model/facade.py | ohsu-qin/qiprofile-rest-client | 0d4190854966f8bdb9ef40dc599358a620c99376 | [
"BSD-2-Clause"
] | null | null | null | qirest_client/model/facade.py | ohsu-qin/qiprofile-rest-client | 0d4190854966f8bdb9ef40dc599358a620c99376 | [
"BSD-2-Clause"
] | null | null | null | """This facade helper module provides a qiprofile REST facade."""
import os
import re
from qiutil.logging import logger
from .model.subject import Subject
from .model.imaging import (Session, Modeling)
SBJ_REGEX = re.compile('^(\w+?)(\d+)$')
SESS_REGEX = re.compile('^Session(\d+)$')
def find_subject(project, subje... | 30.986014 | 81 | 0.652449 |
import os
import re
from qiutil.logging import logger
from .model.subject import Subject
from .model.imaging import (Session, Modeling)
SBJ_REGEX = re.compile('^(\w+?)(\d+)$')
SESS_REGEX = re.compile('^Session(\d+)$')
def find_subject(project, subject, create=False):
collection, sbj_nbr_str = SBJ_REGEX.mat... | true | true |
1c161640a3687c5532aee20baf34021dcd005149 | 1,701 | py | Python | examples/client.py | chevah/socks5 | dc3e1c9857014abfbe31b3ce08886d04d3e33520 | [
"MIT"
] | 33 | 2016-11-15T23:12:37.000Z | 2022-03-05T16:45:13.000Z | examples/client.py | chevah/socks5 | dc3e1c9857014abfbe31b3ce08886d04d3e33520 | [
"MIT"
] | 19 | 2016-08-24T03:16:22.000Z | 2019-03-15T07:46:25.000Z | examples/client.py | chevah/socks5 | dc3e1c9857014abfbe31b3ce08886d04d3e33520 | [
"MIT"
] | 8 | 2016-08-24T03:10:18.000Z | 2019-12-07T22:59:56.000Z | from __future__ import absolute_import, unicode_literals, print_function
import argparse
import socket
from socks5 import GreetingRequest, Request
from socks5 import AUTH_TYPE, REQ_COMMAND, ADDR_TYPE
from socks5 import Connection
def connect(host, port):
print("Starting socks server at {host} {port}".format(**o... | 27.885246 | 101 | 0.680776 | from __future__ import absolute_import, unicode_literals, print_function
import argparse
import socket
from socks5 import GreetingRequest, Request
from socks5 import AUTH_TYPE, REQ_COMMAND, ADDR_TYPE
from socks5 import Connection
def connect(host, port):
print("Starting socks server at {host} {port}".format(**o... | true | true |
1c16165c8f1caacc4026717da55c78ca4bfeecd6 | 6,203 | py | Python | tests/unit/test_github_webhook_lambda.py | smatsumt/github-slack-integration-lambda | 9546aeb2b78e0cf911000deca75143958d7921ff | [
"MIT"
] | 1 | 2020-04-26T07:54:54.000Z | 2020-04-26T07:54:54.000Z | tests/unit/test_github_webhook_lambda.py | smatsumt/github-slack-integration-lambda | 9546aeb2b78e0cf911000deca75143958d7921ff | [
"MIT"
] | null | null | null | tests/unit/test_github_webhook_lambda.py | smatsumt/github-slack-integration-lambda | 9546aeb2b78e0cf911000deca75143958d7921ff | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from pathlib import Path
from unittest.mock import MagicMock
SCRIPT_PATH = Path(__file__).parent.resolve()
def test_find_mentioned_user():
""" メッセージ中の mention を拾うことのテスト """
import github_webhook_lambda
# 通常のケース
r = github_webhook_lambda._fi... | 47.351145 | 172 | 0.750605 |
import json
from pathlib import Path
from unittest.mock import MagicMock
SCRIPT_PATH = Path(__file__).parent.resolve()
def test_find_mentioned_user():
import github_webhook_lambda
r = github_webhook_lambda._find_mentioned_user("@hoge @huga text text")
assert r == {"@hoge", "@huga"}
r = git... | true | true |
1c161747ff691719ba0a2d9d52879fb9f6191530 | 8,826 | py | Python | classes/nodes/scenario.py | brunobcfum/pymace | 366bdc54e2e20fd128f7580fec72294c53b0a98f | [
"MIT"
] | null | null | null | classes/nodes/scenario.py | brunobcfum/pymace | 366bdc54e2e20fd128f7580fec72294c53b0a98f | [
"MIT"
] | 1 | 2021-11-23T12:02:42.000Z | 2021-11-23T12:02:42.000Z | classes/nodes/scenario.py | brunobcfum/pymace | 366bdc54e2e20fd128f7580fec72294c53b0a98f | [
"MIT"
] | null | null | null | """
Scenario class
"""
__author__ = "Bruno Chianca Ferreira"
__license__ = "MIT"
__version__ = "0.2"
__maintainer__ = "Bruno Chianca Ferreira"
__email__ = "brunobcf@gmail.com"
from classes.nodes.gen_node import GenericNode
from classes.mobility import node_mobility
from classes.runner.bus import Bus
#Core libs
from ... | 39.053097 | 186 | 0.625085 | __author__ = "Bruno Chianca Ferreira"
__license__ = "MIT"
__version__ = "0.2"
__maintainer__ = "Bruno Chianca Ferreira"
__email__ = "brunobcf@gmail.com"
from classes.nodes.gen_node import GenericNode
from classes.mobility import node_mobility
from classes.runner.bus import Bus
from core.emulator.data import IpPrefixe... | true | true |
1c16174a281f10fc0485bf82a9eba82f0c3edfda | 8,530 | py | Python | src/twisted/internet/_resolver.py | mathieui/twisted | 35546d2b50742a32edba54719ce3e752dc50dd2a | [
"MIT",
"Unlicense"
] | 9,953 | 2019-04-03T23:41:04.000Z | 2022-03-31T11:54:44.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/_resolver.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 44 | 2019-05-27T10:59:29.000Z | 2022-03-31T14:14:29.000Z | stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/_resolver.py | W4LKURE/learn_python3_spider | 98dd354a41598b31302641f9a0ea49d1ecfa0fb1 | [
"MIT"
] | 2,803 | 2019-04-06T13:15:33.000Z | 2022-03-31T07:42:01.000Z | # -*- test-case-name: twisted.internet.test.test_resolver -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
IPv6-aware hostname resolution.
@see: L{IHostnameResolver}
"""
from __future__ import division, absolute_import
__metaclass__ = type
from socket import (getaddrinfo, AF_INET, AF... | 30.464286 | 79 | 0.63857 |
from __future__ import division, absolute_import
__metaclass__ = type
from socket import (getaddrinfo, AF_INET, AF_INET6, AF_UNSPEC, SOCK_STREAM,
SOCK_DGRAM, gaierror)
from zope.interface import implementer
from twisted.internet.interfaces import (IHostnameResolver, IHostResolution,
... | true | true |
1c1617548655db13124a1b084964cf862d0d7799 | 5,469 | py | Python | R-CNN/utils/template.py | phww/Study-Model-Myself | f7cb97899c6711b0105b9e4c7ad0eecdda2ad0b4 | [
"MIT"
] | null | null | null | R-CNN/utils/template.py | phww/Study-Model-Myself | f7cb97899c6711b0105b9e4c7ad0eecdda2ad0b4 | [
"MIT"
] | null | null | null | R-CNN/utils/template.py | phww/Study-Model-Myself | f7cb97899c6711b0105b9e4c7ad0eecdda2ad0b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# _*_ coding: utf-8 _*_
# @Time : 2021/5/14 下午4:59
# @Author : PH
# @Version:V 0.1
# @File : template.py
# @desc :
import torch
import os
import os.path as osp
class TemplateModel:
def __init__(self):
# tensorboard
self.writer = None
# 训练状态
self.global_step = ... | 33.552147 | 131 | 0.560432 | import torch
import os
import os.path as osp
class TemplateModel:
def __init__(self):
self.writer = None
self.global_step = 0
self.epoch = 0
self.best_acc = 0.0
self.model = None
self.optimizer = None
self.criterion = None
sel... | true | true |
1c16177526dc5fda47cdbc4a917c6bd60bf4c0c3 | 5,814 | py | Python | main.py | zauberwild/rotationsmatrizen | b4100737411039dfbad34d519437b21385bb4aef | [
"MIT"
] | null | null | null | main.py | zauberwild/rotationsmatrizen | b4100737411039dfbad34d519437b21385bb4aef | [
"MIT"
] | null | null | null | main.py | zauberwild/rotationsmatrizen | b4100737411039dfbad34d519437b21385bb4aef | [
"MIT"
] | null | null | null |
from tkinter.constants import E, W
from pygame.constants import RESIZABLE
import classes
import pygame
import tkinter as tk
from math import pi
# * pygame screen init
pygame.init()
SCREEN_WIDTH, SCREEN_HEIGHT = 800, 600
FPS = 60
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT), RESIZABLE)
pygame.disp... | 25.612335 | 141 | 0.707602 |
from tkinter.constants import E, W
from pygame.constants import RESIZABLE
import classes
import pygame
import tkinter as tk
from math import pi
pygame.init()
SCREEN_WIDTH, SCREEN_HEIGHT = 800, 600
FPS = 60
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT), RESIZABLE)
pygame.display.set_caption("3D Vie... | true | true |
1c1617d2ce317a4ef49750bf8846e0ce4a22ceab | 1,351 | py | Python | nipype/interfaces/niftyseg/tests/test_auto_BinaryMathsInteger.py | HussainAther/nipype | 7e33d086fd5cea6ef6de99ee3e35929c1d5730d4 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/niftyseg/tests/test_auto_BinaryMathsInteger.py | HussainAther/nipype | 7e33d086fd5cea6ef6de99ee3e35929c1d5730d4 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/niftyseg/tests/test_auto_BinaryMathsInteger.py | HussainAther/nipype | 7e33d086fd5cea6ef6de99ee3e35929c1d5730d4 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..maths import BinaryMathsInteger
def test_BinaryMathsInteger_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,... | 25.018519 | 67 | 0.641007 | from __future__ import unicode_literals
from ..maths import BinaryMathsInteger
def test_BinaryMathsInteger_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_file=dict(argstr='... | true | true |
1c1619a2885002bdef7728d8c773c3284e0f3ce6 | 6,948 | py | Python | tests/test_cli.py | dongfangtianyu/openapi-python-client | af09640a470a13de6ea50148fdceada3a6c54f02 | [
"MIT"
] | null | null | null | tests/test_cli.py | dongfangtianyu/openapi-python-client | af09640a470a13de6ea50148fdceada3a6c54f02 | [
"MIT"
] | null | null | null | tests/test_cli.py | dongfangtianyu/openapi-python-client | af09640a470a13de6ea50148fdceada3a6c54f02 | [
"MIT"
] | null | null | null | from pathlib import Path
from unittest.mock import MagicMock
import pytest
from typer.testing import CliRunner
from openapi_python_client.parser.errors import GeneratorError, ParseError
runner = CliRunner()
def test_version(mocker):
generate = mocker.patch("openapi_python_client.cli.generate")
from openapi... | 36.376963 | 119 | 0.684514 | from pathlib import Path
from unittest.mock import MagicMock
import pytest
from typer.testing import CliRunner
from openapi_python_client.parser.errors import GeneratorError, ParseError
runner = CliRunner()
def test_version(mocker):
generate = mocker.patch("openapi_python_client.cli.generate")
from openapi... | true | true |
1c161bed5c6ec2570e904847e4a3d049c6b2bc76 | 1,031 | py | Python | scraper/storage_spiders/honeysvn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | null | null | null | scraper/storage_spiders/honeysvn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 10 | 2020-02-11T23:34:28.000Z | 2022-03-11T23:16:12.000Z | scraper/storage_spiders/honeysvn.py | chongiadung/choinho | d2a216fe7a5064d73cdee3e928a7beef7f511fd1 | [
"MIT"
] | 3 | 2018-08-05T14:54:25.000Z | 2021-06-07T01:49:59.000Z | # Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@class='chitiet_center_title']/h1",
'price' : "//div[@class='chitiet_center_title']/div[@class='gia']",
'category' : "//div[... | 38.185185 | 89 | 0.633366 | from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//div[@class='chitiet_center_title']/h1",
'price' : "//div[@class='chitiet_center_title']/div[@class='gia']",
'category' : "//div[@class='chitiet']/div[@class='chitiet_top']/a",
'description' : "//div[@i... | true | true |
1c161cd3b9774453f370b13eaa519585394d8074 | 6,661 | py | Python | test/functional/bcs_signrawsender.py | admecoin/ethcpp | d101f288b887926dc2272391fecf7c980eb8a18e | [
"MIT"
] | null | null | null | test/functional/bcs_signrawsender.py | admecoin/ethcpp | d101f288b887926dc2272391fecf7c980eb8a18e | [
"MIT"
] | null | null | null | test/functional/bcs_signrawsender.py | admecoin/ethcpp | d101f288b887926dc2272391fecf7c980eb8a18e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2020 The Qtum Core developers
# Copyright (c) 2020 The BCS Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test... | 54.598361 | 268 | 0.667017 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.blocktools import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.bcs import *
class BCSSignRawSenderTest(BitcoinTestFramework):
def set_test_params... | true | true |
1c161d6f571bc76d5708886b70b3fb9f7eb45c70 | 4,030 | py | Python | u2net_test.py | dreamer121121/U-2-Net | 99fbfbab1126677f8596ea04fa40c5baadea73db | [
"Apache-2.0"
] | null | null | null | u2net_test.py | dreamer121121/U-2-Net | 99fbfbab1126677f8596ea04fa40c5baadea73db | [
"Apache-2.0"
] | null | null | null | u2net_test.py | dreamer121121/U-2-Net | 99fbfbab1126677f8596ea04fa40c5baadea73db | [
"Apache-2.0"
] | null | null | null | import os
from skimage import io, transform
import torch
import torchvision
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms#, utils
# import torch.optim as optim
import numpy as np
from PIL imp... | 31.24031 | 93 | 0.59603 | import os
from skimage import io, transform
import torch
import torchvision
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms
import numpy as np
from PIL import Image
import glob
from data_loader... | true | true |
1c161dd429a809d1ad3d8cba341395130ab1fa9c | 4,946 | py | Python | docs/conf.py | saltastro/salt-api-server | 8cf9c7c7ae6b7ff9031e85d0baba22e80b2d0579 | [
"MIT"
] | null | null | null | docs/conf.py | saltastro/salt-api-server | 8cf9c7c7ae6b7ff9031e85d0baba22e80b2d0579 | [
"MIT"
] | null | null | null | docs/conf.py | saltastro/salt-api-server | 8cf9c7c7ae6b7ff9031e85d0baba22e80b2d0579 | [
"MIT"
] | null | null | null | # salt_api_server documentation build configuration file.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve ... | 29.975758 | 77 | 0.690659 |
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.pardir))
import salt_api_server
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
templates_path = ['_templates']
source_suffix = ['.rst', '.md']
source_parsers = {
'.md': 'recommonmark.parser.CommonMarkParser',
}
master_doc = 'index'... | true | true |
1c1620b745b1be02a9638db6569cd55677d2c99f | 49,410 | py | Python | gelidum/tests/gelidum_tests/test_freeze.py | diegojromerolopez/freeze | 850c061395ea2d2a04193b236fd3862092faa7df | [
"MIT"
] | 51 | 2021-06-03T01:23:04.000Z | 2022-02-18T22:16:36.000Z | gelidum/tests/gelidum_tests/test_freeze.py | diegojromerolopez/freeze | 850c061395ea2d2a04193b236fd3862092faa7df | [
"MIT"
] | 11 | 2021-06-15T08:39:02.000Z | 2021-11-29T22:56:12.000Z | gelidum/tests/gelidum_tests/test_freeze.py | diegojromerolopez/freeze | 850c061395ea2d2a04193b236fd3862092faa7df | [
"MIT"
] | 4 | 2021-06-15T02:55:57.000Z | 2021-09-27T07:47:51.000Z | import copy
import datetime
import io
import json
import logging
import pickle
import sys
import tempfile
import threading
import unittest
import warnings
from typing import Dict, List, Union, Any
from unittest.mock import patch
from gelidum import FrozenException
from gelidum import freeze
from gelidum.collections imp... | 41.696203 | 100 | 0.634426 | import copy
import datetime
import io
import json
import logging
import pickle
import sys
import tempfile
import threading
import unittest
import warnings
from typing import Dict, List, Union, Any
from unittest.mock import patch
from gelidum import FrozenException
from gelidum import freeze
from gelidum.collections imp... | true | true |
1c16225a6d5c39ef3e580e590d17e1294cae5c63 | 784 | py | Python | users/permissions.py | SDOS2020/Team_8_Alohomora_CareerShala | 752e43a03ce365020b6523ccb00c967b1cd6aacc | [
"CC-BY-4.0"
] | null | null | null | users/permissions.py | SDOS2020/Team_8_Alohomora_CareerShala | 752e43a03ce365020b6523ccb00c967b1cd6aacc | [
"CC-BY-4.0"
] | 14 | 2020-12-06T21:44:45.000Z | 2021-06-10T20:29:47.000Z | users/permissions.py | SDOS2020/Team_8_Alohomora_CareerShala | 752e43a03ce365020b6523ccb00c967b1cd6aacc | [
"CC-BY-4.0"
] | null | null | null | from rest_framework import permissions
class IsStudent(permissions.BasePermission):
message = 'Only students can access this feature.'
def has_permission(self, request, view):
return not request.user.is_expert
class IsAdmin(permissions.BasePermission):
message = 'Only admins can access this fea... | 26.133333 | 54 | 0.746173 | from rest_framework import permissions
class IsStudent(permissions.BasePermission):
message = 'Only students can access this feature.'
def has_permission(self, request, view):
return not request.user.is_expert
class IsAdmin(permissions.BasePermission):
message = 'Only admins can access this fea... | true | true |
1c1622f3824b9e231c919d5487fb7909972d8c00 | 5,264 | py | Python | src/python/bot/fuzzers/options.py | avineshwar/clusterfuzz | cd72fc66fb5cd4013196662c3564339a940e1c41 | [
"Apache-2.0"
] | null | null | null | src/python/bot/fuzzers/options.py | avineshwar/clusterfuzz | cd72fc66fb5cd4013196662c3564339a940e1c41 | [
"Apache-2.0"
] | null | null | null | src/python/bot/fuzzers/options.py | avineshwar/clusterfuzz | cd72fc66fb5cd4013196662c3564339a940e1c41 | [
"Apache-2.0"
] | 1 | 2020-04-25T16:37:10.000Z | 2020-04-25T16:37:10.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 29.909091 | 80 | 0.704787 |
from future import standard_library
standard_library.install_aliases()
from builtins import object
import configparser
import os
import random
import re
import six
from bot.fuzzers import utils as fuzzer_utils
from bot.fuzzers.afl import constants as afl_constants
from metrics import logs
from system import environme... | true | true |
1c1623452c3a4c441da2eb8e958fb5b5c3724efe | 1,217 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/subscriber/subscribergxinterface_args.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/subscriber/subscribergxinterface_args.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/subscriber/subscribergxinterface_args.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 28.97619 | 101 | 0.714873 |
class subscribergxinterface_args :
def __init__(self) :
self._nodeid = None
@property
def nodeid(self) :
try :
return self._nodeid
except Exception as e:
raise e
@nodeid.setter
def nodeid(self, nodeid) :
try :
self._nodeid = nodeid
except Exception as e:
raise e
| true | true |
1c16237c02142d060e405467950a45dbdbe6aca8 | 10,163 | py | Python | pysnmp/CYAN-PEM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CYAN-PEM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CYAN-PEM-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CYAN-PEM-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CYAN-PEM-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:18:29 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019,... | 125.469136 | 1,166 | 0.758437 | OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.impo... | true | true |
1c1623950dcfa6eb8abfe488c5503042a61c71c1 | 2,157 | py | Python | Simple GAN/train.py | Srujan35007/My-GANs | 7953c859169134a0a84ac3cd674f629af9942465 | [
"MIT"
] | null | null | null | Simple GAN/train.py | Srujan35007/My-GANs | 7953c859169134a0a84ac3cd674f629af9942465 | [
"MIT"
] | null | null | null | Simple GAN/train.py | Srujan35007/My-GANs | 7953c859169134a0a84ac3cd674f629af9942465 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import random
from networks import Generator, Discriminator
import matplotlib.pyplot as plt
print('Imports complete')
def normalize(array, original_range, target_range):
min_array,max_array = or... | 34.790323 | 95 | 0.697728 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import random
from networks import Generator, Discriminator
import matplotlib.pyplot as plt
print('Imports complete')
def normalize(array, original_range, target_range):
min_array,max_array = or... | true | true |
1c1623de877874571b75a07455b37d806cee6cbf | 3,976 | py | Python | src/typecode/_vendor/pygments/lexers/boa.py | tardyp/typecode | 45011e9fc72ed149aeba554665487d5505e0fb00 | [
"Apache-2.0"
] | null | null | null | src/typecode/_vendor/pygments/lexers/boa.py | tardyp/typecode | 45011e9fc72ed149aeba554665487d5505e0fb00 | [
"Apache-2.0"
] | null | null | null | src/typecode/_vendor/pygments/lexers/boa.py | tardyp/typecode | 45011e9fc72ed149aeba554665487d5505e0fb00 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pygments.lexers.boa
~~~~~~~~~~~~~~~~~~~
Lexers for the Boa language.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from typecode._vendor.pygments.lexer import RegexLexer, words
from typecode._v... | 38.601942 | 91 | 0.495724 |
import re
from typecode._vendor.pygments.lexer import RegexLexer, words
from typecode._vendor.pygments.token import String, Comment, Keyword, Name, Number, Text, \
Operator, Punctuation
__all__ = ['BoaLexer']
line_re = re.compile('.*?\n')
class BoaLexer(RegexLexer):
name = 'Boa'
aliases = ['boa']
... | true | true |
1c16242e987d9f058967e5990a9c39edcf34dd20 | 49 | py | Python | switcher/__init__.py | Kareem-Emad/switch-py | 398bc324b95ce8193e037d015a29f8035550552f | [
"MIT"
] | null | null | null | switcher/__init__.py | Kareem-Emad/switch-py | 398bc324b95ce8193e037d015a29f8035550552f | [
"MIT"
] | null | null | null | switcher/__init__.py | Kareem-Emad/switch-py | 398bc324b95ce8193e037d015a29f8035550552f | [
"MIT"
] | null | null | null | from . import publisher
__all__ = ['publisher']
| 12.25 | 23 | 0.714286 | from . import publisher
__all__ = ['publisher']
| true | true |
1c16247819508e03a1033ef3fac41ea9dfe0a566 | 336 | py | Python | rob599_more/src/flood.py | OSUrobotics/rob599 | 0da63ef9a36e174f782c00f56099eb71bc15ca8b | [
"BSD-3-Clause"
] | 6 | 2020-10-01T16:57:53.000Z | 2021-11-30T22:39:07.000Z | rob599_more/src/flood.py | OSUrobotics/rob599 | 0da63ef9a36e174f782c00f56099eb71bc15ca8b | [
"BSD-3-Clause"
] | null | null | null | rob599_more/src/flood.py | OSUrobotics/rob599 | 0da63ef9a36e174f782c00f56099eb71bc15ca8b | [
"BSD-3-Clause"
] | 2 | 2020-11-10T21:14:10.000Z | 2020-12-15T18:40:16.000Z | #!/usr/bin/env python3
import rospy
import sys
from std_msgs.msg import Int64
if __name__ == '__main__':
rospy.init_node('flood', argv =sys.argv)
pub = rospy.Publisher('flood', Int64, queue_size=1)
counter = 0
while not rospy.is_shutdown():
pub.publish(counter)
counter += 1
print('\nSent {0} messages'.... | 16.8 | 52 | 0.705357 |
import rospy
import sys
from std_msgs.msg import Int64
if __name__ == '__main__':
rospy.init_node('flood', argv =sys.argv)
pub = rospy.Publisher('flood', Int64, queue_size=1)
counter = 0
while not rospy.is_shutdown():
pub.publish(counter)
counter += 1
print('\nSent {0} messages'.format(counter)) | true | true |
1c162515ff3c23c8565d8c39d2efc3b1ca354d45 | 11,206 | py | Python | tests/trestle/core/commands/author/ssp_test.py | CyberFlameGO/compliance-trestle | aeae771e0e90c7c69ef914ca02d4857ed6f50222 | [
"Apache-2.0"
] | null | null | null | tests/trestle/core/commands/author/ssp_test.py | CyberFlameGO/compliance-trestle | aeae771e0e90c7c69ef914ca02d4857ed6f50222 | [
"Apache-2.0"
] | null | null | null | tests/trestle/core/commands/author/ssp_test.py | CyberFlameGO/compliance-trestle | aeae771e0e90c7c69ef914ca02d4857ed6f50222 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 IBM Corp. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 38.508591 | 114 | 0.718008 |
import argparse
import pathlib
from typing import Tuple
import pytest
from ruamel.yaml import YAML
from tests import test_utils
import trestle.oscal.ssp as ossp
from trestle.core import const
from trestle.core.commands.author.ssp import SSPAssemble, SSPFilter, SSPGenerate
from trestle.core.control_io import Contro... | true | true |
1c1626bad795e81878d3f31ab3c94993a62edc1d | 372 | py | Python | awslambdaric/__main__.py | preearor/aws-lambda-python-runtime-interface-client | cc60047cbc4aa576fef72a9dfca0d1fcb0da00b4 | [
"Apache-2.0"
] | 136 | 2020-12-01T18:33:09.000Z | 2022-03-26T19:42:37.000Z | awslambdaric/__main__.py | pushkarchawda/aws-lambda-python-runtime-interface-client | 67ff94e107bb3ae80c4f7f3aef40858185fb11fb | [
"Apache-2.0"
] | 43 | 2020-12-03T00:03:10.000Z | 2022-03-31T08:42:55.000Z | awslambdaric/__main__.py | pushkarchawda/aws-lambda-python-runtime-interface-client | 67ff94e107bb3ae80c4f7f3aef40858185fb11fb | [
"Apache-2.0"
] | 42 | 2020-12-01T19:09:39.000Z | 2022-03-02T19:36:52.000Z | """
Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
"""
import os
import sys
from . import bootstrap
def main(args):
app_root = os.getcwd()
handler = args[1]
lambda_runtime_api_addr = os.environ["AWS_LAMBDA_RUNTIME_API"]
bootstrap.run(app_root, handler, lambda_runtime_api_ad... | 17.714286 | 71 | 0.712366 |
import os
import sys
from . import bootstrap
def main(args):
app_root = os.getcwd()
handler = args[1]
lambda_runtime_api_addr = os.environ["AWS_LAMBDA_RUNTIME_API"]
bootstrap.run(app_root, handler, lambda_runtime_api_addr)
if __name__ == "__main__":
main(sys.argv)
| true | true |
1c162744ac6dd86c269e13ddabdc4cee5caccdb4 | 4,163 | py | Python | openauth/views.py | daimon99/django-openauth | 8b28fd70eb4a15190606894e8c2f2167ffdddb69 | [
"Apache-2.0"
] | null | null | null | openauth/views.py | daimon99/django-openauth | 8b28fd70eb4a15190606894e8c2f2167ffdddb69 | [
"Apache-2.0"
] | null | null | null | openauth/views.py | daimon99/django-openauth | 8b28fd70eb4a15190606894e8c2f2167ffdddb69 | [
"Apache-2.0"
] | null | null | null | import logging
import jwt
from django.contrib import auth
from django.contrib.auth import get_user_model
from django.contrib.auth.views import LoginView
from django.core.cache import cache
from django.http import HttpResponseRedirect
# Create your views here.
from django.utils.decorators import method_decorator
from d... | 33.304 | 93 | 0.630315 | import logging
import jwt
from django.contrib import auth
from django.contrib.auth import get_user_model
from django.contrib.auth.views import LoginView
from django.core.cache import cache
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.utils.timezone impor... | true | true |
1c162783ca7ce8bae8d573d23da32fe284a74ee9 | 2,967 | py | Python | bot/bot.py | gracewgao/prepear | a252628689710dc4c6c1cbe24e2357bc3812f8c4 | [
"MIT"
] | 1 | 2021-09-11T10:01:21.000Z | 2021-09-11T10:01:21.000Z | bot/bot.py | gracewgao/prepear | a252628689710dc4c6c1cbe24e2357bc3812f8c4 | [
"MIT"
] | null | null | null | bot/bot.py | gracewgao/prepear | a252628689710dc4c6c1cbe24e2357bc3812f8c4 | [
"MIT"
] | 1 | 2021-01-17T18:02:47.000Z | 2021-01-17T18:02:47.000Z | import os
import discord
import asyncio
import configparser
import discord
from discord.ext import commands
import json
import random
from .database import *
client = commands.Bot(command_prefix = '!')
@client.event
async def on_ready():
print('Logged in as: {0} - {1}'.format(client.user.name, client.user.id))
... | 27.728972 | 82 | 0.628918 | import os
import discord
import asyncio
import configparser
import discord
from discord.ext import commands
import json
import random
from .database import *
client = commands.Bot(command_prefix = '!')
@client.event
async def on_ready():
print('Logged in as: {0} - {1}'.format(client.user.name, client.user.id))
... | true | true |
1c16279947ac85169d90978a629aadaa2326b3f6 | 2,735 | py | Python | tests/test_sequence_loop.py | saeedou/adia | 86dc0c96c9b0bd804dff208e91c71a1958df56b0 | [
"MIT"
] | 17 | 2021-07-29T08:26:08.000Z | 2022-03-26T23:26:38.000Z | tests/test_sequence_loop.py | saeedou/adia | 86dc0c96c9b0bd804dff208e91c71a1958df56b0 | [
"MIT"
] | 37 | 2021-07-28T08:19:23.000Z | 2021-09-24T17:31:07.000Z | tests/test_sequence_loop.py | saeedou/adia | 86dc0c96c9b0bd804dff208e91c71a1958df56b0 | [
"MIT"
] | 3 | 2021-09-14T10:54:51.000Z | 2022-01-04T15:37:35.000Z | from adia import Diagram
from .helpers import eqdia
def test_sequence_loop():
d = Diagram('''
sequence:
for: i in 0~10
b -> a
if: yes
while: True
a -> c
''')
assert eqdia(d, '''
........................
. +---+ +---+ +---+ .
. ... | 29.095745 | 46 | 0.106764 | from adia import Diagram
from .helpers import eqdia
def test_sequence_loop():
d = Diagram('''
sequence:
for: i in 0~10
b -> a
if: yes
while: True
a -> c
''')
assert eqdia(d, '''
........................
. +---+ +---+ +---+ .
. ... | true | true |
1c1628f37687b383bcddc65886e17ef8e2cc75a5 | 9,778 | py | Python | api/namex/resources/auto_analyse/issues/abstract/analysis_response_issue.py | riyazuddinsyed/namex | c100ef4378794f509b738d38276e3b902d26067a | [
"Apache-2.0"
] | null | null | null | api/namex/resources/auto_analyse/issues/abstract/analysis_response_issue.py | riyazuddinsyed/namex | c100ef4378794f509b738d38276e3b902d26067a | [
"Apache-2.0"
] | null | null | null | api/namex/resources/auto_analyse/issues/abstract/analysis_response_issue.py | riyazuddinsyed/namex | c100ef4378794f509b738d38276e3b902d26067a | [
"Apache-2.0"
] | null | null | null | import abc
from collections import deque
# Import DTOs
from ...response_objects import NameAnalysisIssue
class AnalysisResponseIssue:
issue_type = "Issue" # Maybe get rid of this guy
header = "Further Action Required"
status_text = ""
status = "fa" # This is a CODE [AV | FA | RC]
issue = None
... | 39.427419 | 146 | 0.623747 | import abc
from collections import deque
from ...response_objects import NameAnalysisIssue
class AnalysisResponseIssue:
issue_type = "Issue" header = "Further Action Required"
status_text = ""
status = "fa" issue = None
def __init__(self, analysis_response, setup_config):
self.anal... | true | true |
1c162901c67d5345a27ff224f6daf82ca8cdeac3 | 20,926 | py | Python | guillotina/contrib/catalog/pg.py | Qiwn/guillotina | 1ed545497424d23de63984961cab5243f4a200ec | [
"BSD-2-Clause"
] | null | null | null | guillotina/contrib/catalog/pg.py | Qiwn/guillotina | 1ed545497424d23de63984961cab5243f4a200ec | [
"BSD-2-Clause"
] | null | null | null | guillotina/contrib/catalog/pg.py | Qiwn/guillotina | 1ed545497424d23de63984961cab5243f4a200ec | [
"BSD-2-Clause"
] | null | null | null | import json
import logging
import typing
from dateutil.parser import parse
from guillotina import configure
from guillotina.auth.users import AnonymousUser
from guillotina.catalog.catalog import DefaultSearchUtility
from guillotina.catalog.parser import BaseParser
from guillotina.catalog.parser import to_list
from gui... | 34.531353 | 120 | 0.589363 | import json
import logging
import typing
from dateutil.parser import parse
from guillotina import configure
from guillotina.auth.users import AnonymousUser
from guillotina.catalog.catalog import DefaultSearchUtility
from guillotina.catalog.parser import BaseParser
from guillotina.catalog.parser import to_list
from gui... | true | true |
1c162915fae6b182d564123c8c2f27685af8c031 | 13,234 | py | Python | wagtail/blocks/list_block.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | 1 | 2022-02-09T05:25:30.000Z | 2022-02-09T05:25:30.000Z | wagtail/blocks/list_block.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | null | null | null | wagtail/blocks/list_block.py | stevedya/wagtail | 52e5abfe62547cdfd90ea7dfeb8bf5a52f16324c | [
"BSD-3-Clause"
] | null | null | null | import uuid
from collections.abc import MutableSequence
from django import forms
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorList
from django.utils.functional import cached_property
from django.utils.html import format_html, format_html_join
from django.utils.translation impo... | 33.933333 | 106 | 0.582364 | import uuid
from collections.abc import MutableSequence
from django import forms
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorList
from django.utils.functional import cached_property
from django.utils.html import format_html, format_html_join
from django.utils.translation impo... | true | true |
1c1629d2c32813788a9081466f9c472d33985c74 | 46 | py | Python | lain_cli/__init__.py | timfeirg/lain-cli | c8745a31ef4b19d855845bd5fab93bf10b8a4369 | [
"MIT"
] | 14 | 2022-01-13T22:28:33.000Z | 2022-03-29T11:08:05.000Z | lain_cli/__init__.py | timfeirg/lain-cli | c8745a31ef4b19d855845bd5fab93bf10b8a4369 | [
"MIT"
] | 23 | 2022-01-26T16:50:41.000Z | 2022-03-29T11:24:10.000Z | lain_cli/__init__.py | timfeirg/lain-cli | c8745a31ef4b19d855845bd5fab93bf10b8a4369 | [
"MIT"
] | 4 | 2022-02-09T04:06:36.000Z | 2022-02-16T10:51:24.000Z | __version__ = '4.10.44'
package_name = 'lain'
| 15.333333 | 23 | 0.695652 | __version__ = '4.10.44'
package_name = 'lain'
| true | true |
1c1629ff58f3a3c3ada342bf0d5d05fa62e86833 | 9,656 | py | Python | specklepy/synthetic/generate_exposure.py | felixbosco/specklepy | 18f1d542f04cbe31fec8675791bf8350a09441c6 | [
"MIT"
] | null | null | null | specklepy/synthetic/generate_exposure.py | felixbosco/specklepy | 18f1d542f04cbe31fec8675791bf8350a09441c6 | [
"MIT"
] | null | null | null | specklepy/synthetic/generate_exposure.py | felixbosco/specklepy | 18f1d542f04cbe31fec8675791bf8350a09441c6 | [
"MIT"
] | 2 | 2020-12-07T14:21:13.000Z | 2021-02-26T13:52:52.000Z | import os
import numpy as np
from tqdm import trange
from astropy.io import fits
from astropy.units import Quantity
from specklepy.io import config
from specklepy.io import FileStream
from specklepy.logging import logger
from specklepy.synthetic.target import Target
from specklepy.synthetic.telescope import Telescope... | 43.495495 | 119 | 0.639499 | import os
import numpy as np
from tqdm import trange
from astropy.io import fits
from astropy.units import Quantity
from specklepy.io import config
from specklepy.io import FileStream
from specklepy.logging import logger
from specklepy.synthetic.target import Target
from specklepy.synthetic.telescope import Telescope... | true | true |
1c162aaafbcdcdbe276fcc46902d8c7377d52d64 | 1,022 | py | Python | superman/baseline/__init__.py | WasatchPhotonics/superman | dd51773f7ab7dafd8fec7ffc14c8d8cb9b1e19f6 | [
"MIT"
] | 3 | 2017-10-14T15:49:36.000Z | 2021-03-03T23:45:37.000Z | superman/baseline/__init__.py | WasatchPhotonics/superman | dd51773f7ab7dafd8fec7ffc14c8d8cb9b1e19f6 | [
"MIT"
] | 4 | 2017-12-28T23:34:13.000Z | 2018-02-16T18:31:31.000Z | superman/baseline/__init__.py | vishalbelsare/superman | 346fc0d590f40bfe0141630e3146ec8e7ee18be3 | [
"MIT"
] | 5 | 2017-11-28T15:11:01.000Z | 2021-07-12T15:34:18.000Z | from __future__ import absolute_import
import warnings
# Import class wrappers for each type of baseline alg.
from .airpls import AirPLS
from .als import ALS
from .dietrich import Dietrich
from .fabc import FABC
from .kajfosz_kwiatek import KajfoszKwiatek
from .median import MedianFilter
from .mpls import MPLS
# from ... | 26.894737 | 76 | 0.759295 | from __future__ import absolute_import
import warnings
from .airpls import AirPLS
from .als import ALS
from .dietrich import Dietrich
from .fabc import FABC
from .kajfosz_kwiatek import KajfoszKwiatek
from .median import MedianFilter
from .mpls import MPLS
from .polyfit import PolyFit
from .rubberband import Rubberban... | true | true |
1c162bba3560d8dcd6d8ce0a4ba63f86af234f55 | 7,037 | py | Python | src/tests/functional/agenda/test_agenda_schedule.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | src/tests/functional/agenda/test_agenda_schedule.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | src/tests/functional/agenda/test_agenda_schedule.py | td00/pretalx | aff450de9420fca167e04345fa24ee7140fae819 | [
"Apache-2.0"
] | null | null | null | import datetime
from urllib.parse import quote
import pytest
from django.urls import reverse
from django.utils import formats
@pytest.mark.django_db
def test_can_see_schedule(client, event, slot):
del event.current_schedule
response = client.get(event.urls.schedule, follow=True)
assert event.schedules.co... | 38.664835 | 117 | 0.75103 | import datetime
from urllib.parse import quote
import pytest
from django.urls import reverse
from django.utils import formats
@pytest.mark.django_db
def test_can_see_schedule(client, event, slot):
del event.current_schedule
response = client.get(event.urls.schedule, follow=True)
assert event.schedules.co... | true | true |
1c162c2f1004615d0ea94dc7f889b05de1de0857 | 1,929 | py | Python | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_linked_service_type_properties_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_linked_service_type_properties_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/models/web_linked_service_type_properties_py3.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 37.823529 | 168 | 0.65267 |
from msrest.serialization import Model
class WebLinkedServiceTypeProperties(Model):
_validation = {
'url': {'required': True},
'authentication_type': {'required': True},
}
_attribute_map = {
'url': {'key': 'url', 'type': 'object'},
'authentication_type': {'key': 'authent... | true | true |
1c162c7618e579e43de0f0d3c3563611569a57de | 447 | py | Python | view_model/vod_viewmodel.py | ghhernandes/brdevstreamers | 32a0cd87943dcfe76ec8863c05b4a03d52814b96 | [
"Apache-2.0"
] | 16 | 2022-02-15T12:11:09.000Z | 2022-03-01T01:59:41.000Z | view_model/vod_viewmodel.py | ghhernandes/brdevstreamers | 32a0cd87943dcfe76ec8863c05b4a03d52814b96 | [
"Apache-2.0"
] | 2 | 2022-02-23T20:53:01.000Z | 2022-02-28T17:22:10.000Z | view_model/vod_viewmodel.py | ghhernandes/brdevstreamers | 32a0cd87943dcfe76ec8863c05b4a03d52814b96 | [
"Apache-2.0"
] | 7 | 2022-02-16T17:37:13.000Z | 2022-03-01T02:00:17.000Z | from typing import Optional
from view_model.user_viewmodel import UserOutViewModel
class VodViewModel(UserOutViewModel):
id: Optional[str]
user_id: Optional[str]
user_name: Optional[str]
title: Optional[str]
viewer_count: Optional[int]
started_at: Optional[str]
thumbnail_url: Optional[str... | 24.833333 | 54 | 0.740492 | from typing import Optional
from view_model.user_viewmodel import UserOutViewModel
class VodViewModel(UserOutViewModel):
id: Optional[str]
user_id: Optional[str]
user_name: Optional[str]
title: Optional[str]
viewer_count: Optional[int]
started_at: Optional[str]
thumbnail_url: Optional[str... | true | true |
1c162c8153e5231f67038b364ef97bcda91188c8 | 21,369 | py | Python | ucsmsdk/mometa/policy/PolicyPolicyScopeCont.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/policy/PolicyPolicyScopeCont.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/policy/PolicyPolicyScopeCont.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for PolicyPolicyScopeCont ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class PolicyPolicyScopeContConsts:
FSM_PREV_REPORT_POLICY_FAIL_FSM_BEGIN = "ReportPolicyFailFsmBegin"... | 94.136564 | 3,723 | 0.771725 |
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class PolicyPolicyScopeContConsts:
FSM_PREV_REPORT_POLICY_FAIL_FSM_BEGIN = "ReportPolicyFailFsmBegin"
FSM_PREV_REPORT_POLICY_FAIL_FSM_FAIL = "ReportPolicyFailFsmFail"
FSM_PREV_REPORT_PO... | true | true |
1c162caaeacb30683a87eacd9a1b89b19fbdbe37 | 10,133 | py | Python | src/hostphot/local_photometry.py | temuller/cosmo_phot | 011333f84486614cb9339d3874dc072c45ebed23 | [
"MIT"
] | null | null | null | src/hostphot/local_photometry.py | temuller/cosmo_phot | 011333f84486614cb9339d3874dc072c45ebed23 | [
"MIT"
] | null | null | null | src/hostphot/local_photometry.py | temuller/cosmo_phot | 011333f84486614cb9339d3874dc072c45ebed23 | [
"MIT"
] | null | null | null | # Check the following urls for more info about Pan-STARRS:
#
# https://outerspace.stsci.edu/display/PANSTARRS/PS1+Image+Cutout+Service#PS1ImageCutoutService-ImportantFITSimageformat,WCS,andflux-scalingnotes
# https://outerspace.stsci.edu/display/PANSTARRS/PS1+Stack+images#PS1Stackimages-Photometriccalibration
#... | 31.468944 | 174 | 0.628047 |
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import sep
from photutils import CircularAperture
from photutils import aperture_photometry
from astropy.io import fits
from astropy import units as u, wcs
from astropy.cosmology import FlatLambdaCDM
from hostphot._constants import __w... | true | true |
1c162d3c7d71b7c8a559bcf4e880ec7eebb4efdf | 289 | py | Python | leaderboard/images/models.py | belak/btta-leaderboard | 0da1863374d69ab0a8388dc6de0a9ffd2046cf40 | [
"MIT"
] | 1 | 2020-06-16T11:33:16.000Z | 2020-06-16T11:33:16.000Z | leaderboard/images/models.py | belak/btta-leaderboard | 0da1863374d69ab0a8388dc6de0a9ffd2046cf40 | [
"MIT"
] | 17 | 2021-04-08T20:46:21.000Z | 2022-02-27T05:20:45.000Z | leaderboard/images/models.py | belak/btta-leaderboard | 0da1863374d69ab0a8388dc6de0a9ffd2046cf40 | [
"MIT"
] | null | null | null | from django.db import models
class Image(models.Model):
name = models.CharField(max_length=255, unique=True)
image = models.ImageField()
enabled = models.BooleanField(default=True)
class Meta:
ordering = ["name"]
def __str__(self):
return self.name
| 20.642857 | 56 | 0.66782 | from django.db import models
class Image(models.Model):
name = models.CharField(max_length=255, unique=True)
image = models.ImageField()
enabled = models.BooleanField(default=True)
class Meta:
ordering = ["name"]
def __str__(self):
return self.name
| true | true |
1c162da0b01c42593bbab69e468ca22533f880ae | 15,723 | py | Python | lib/python3.8/site-packages/ansible_collections/google/cloud/plugins/modules/gcp_pubsub_subscription_info.py | cjsteel/python3-venv-ansible-2.10.5 | c95395c4cae844dc66fddde9b4343966f4b2ecd5 | [
"Apache-1.1"
] | 5 | 2020-12-16T21:42:09.000Z | 2022-03-28T16:04:32.000Z | .ansible/collections/ansible_collections/google/cloud/plugins/modules/gcp_pubsub_subscription_info.py | chronicc/proving-ground | 3e392122a05fb8383a3700954baebb0df330e9e3 | [
"MIT"
] | null | null | null | .ansible/collections/ansible_collections/google/cloud/plugins/modules/gcp_pubsub_subscription_info.py | chronicc/proving-ground | 3e392122a05fb8383a3700954baebb0df330e9e3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | 42.494595 | 124 | 0.645996 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ["preview"], 'supported_by': 'community'}
DOCUMENTATION = '''
---
module: gcp_pubsub_subscription_info
description:
- Gather info for GCP Subscription
short_description: Ga... | true | true |
1c162dcd4618d94967df565e711c424badb7c597 | 3,871 | py | Python | app/user/test/test_users_api.py | MauricioAntonioMartinez/recipie-api-django | 69fd3d097033331cb9531e5ae6220d0931ec40e5 | [
"MIT"
] | null | null | null | app/user/test/test_users_api.py | MauricioAntonioMartinez/recipie-api-django | 69fd3d097033331cb9531e5ae6220d0931ec40e5 | [
"MIT"
] | null | null | null | app/user/test/test_users_api.py | MauricioAntonioMartinez/recipie-api-django | 69fd3d097033331cb9531e5ae6220d0931ec40e5 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
CREATE_USER_URL = reverse('user:create')
# this is like /api/create-user
TOKEN_URL = reverse('user:token')
def create_user(**ka... | 32.805085 | 75 | 0.61612 | from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
CREATE_USER_URL = reverse('user:create')
TOKEN_URL = reverse('user:token')
def create_user(**kargs): return get_user_model... | true | true |
1c162dd236b95256097db6c673d4c307025447f2 | 6,978 | py | Python | recipes/mpir/all/conanfile.py | conan-center-bot-testing/conan-center-index | 3f715cba072640973787fb8bf10e57e2b8d4a4aa | [
"MIT"
] | null | null | null | recipes/mpir/all/conanfile.py | conan-center-bot-testing/conan-center-index | 3f715cba072640973787fb8bf10e57e2b8d4a4aa | [
"MIT"
] | 2 | 2021-07-12T11:40:14.000Z | 2022-03-04T13:15:54.000Z | recipes/mpir/all/conanfile.py | conan-center-bot-testing/conan-center-index | 3f715cba072640973787fb8bf10e57e2b8d4a4aa | [
"MIT"
] | null | null | null | from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild
import os
import glob
class MpirConan(ConanFile):
name = "mpir"
description = "MPIR is a highly optimised library for bignum arithmetic" \
"forked from the GMP bignum library."
topics = ("conan", "mpir", "multiprecisi... | 45.907895 | 127 | 0.608054 | from conans import ConanFile, tools, AutoToolsBuildEnvironment, MSBuild
import os
import glob
class MpirConan(ConanFile):
name = "mpir"
description = "MPIR is a highly optimised library for bignum arithmetic" \
"forked from the GMP bignum library."
topics = ("conan", "mpir", "multiprecisi... | true | true |
1c162e25b2862224f54026dc0f5dc1984a2cd80d | 3,193 | py | Python | tcod/loader_functions/initialize_new_game.py | Javascript-void0/Pygame | 96b4cc9b414a40e684a833306dcf5d191a4f4aa5 | [
"MIT"
] | 1 | 2021-04-09T01:36:32.000Z | 2021-04-09T01:36:32.000Z | tcod/loader_functions/initialize_new_game.py | Javascript-void0/Pygame | 96b4cc9b414a40e684a833306dcf5d191a4f4aa5 | [
"MIT"
] | null | null | null | tcod/loader_functions/initialize_new_game.py | Javascript-void0/Pygame | 96b4cc9b414a40e684a833306dcf5d191a4f4aa5 | [
"MIT"
] | null | null | null | import tcod as libtcod
from components.fighter import Fighter
from components.inventory import Inventory
from components.level import Level
from components.equipment import Equipment
from components.equippable import Equippable
from entity import Entity
from game_messages import MessageLog
from game_states import Gam... | 32.917526 | 212 | 0.701848 | import tcod as libtcod
from components.fighter import Fighter
from components.inventory import Inventory
from components.level import Level
from components.equipment import Equipment
from components.equippable import Equippable
from entity import Entity
from game_messages import MessageLog
from game_states import Gam... | true | true |
1c162e972fa9a28274d4df98fa02fc6a4bbfa431 | 1,438 | py | Python | toontown/fishing/FourCornerBingo.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 99 | 2019-11-02T22:25:00.000Z | 2022-02-03T03:48:00.000Z | toontown/fishing/FourCornerBingo.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 42 | 2019-11-03T05:31:08.000Z | 2022-03-16T22:50:32.000Z | toontown/fishing/FourCornerBingo.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 57 | 2019-11-03T07:47:37.000Z | 2022-03-22T00:41:49.000Z | from direct.directnotify import DirectNotifyGlobal
from toontown.fishing import BingoGlobals
from toontown.fishing import BingoCardBase
class FourCornerBingo(BingoCardBase.BingoCardBase):
notify = DirectNotifyGlobal.directNotify.newCategory('FourCornerBingo')
corners = [0,
BingoGlobals.CARD_ROWS - 1,
... | 39.944444 | 131 | 0.68637 | from direct.directnotify import DirectNotifyGlobal
from toontown.fishing import BingoGlobals
from toontown.fishing import BingoCardBase
class FourCornerBingo(BingoCardBase.BingoCardBase):
notify = DirectNotifyGlobal.directNotify.newCategory('FourCornerBingo')
corners = [0,
BingoGlobals.CARD_ROWS - 1,
... | true | true |
1c162fe4a5f34bdfd8e31eeba4f5ae94f0525c39 | 6,970 | py | Python | tests/snuba/snuba/test_query_subscription_consumer.py | vaniot-s/sentry | 5c1accadebfaf8baf6863251c05b38ea979ee1c7 | [
"BSD-3-Clause"
] | null | null | null | tests/snuba/snuba/test_query_subscription_consumer.py | vaniot-s/sentry | 5c1accadebfaf8baf6863251c05b38ea979ee1c7 | [
"BSD-3-Clause"
] | null | null | null | tests/snuba/snuba/test_query_subscription_consumer.py | vaniot-s/sentry | 5c1accadebfaf8baf6863251c05b38ea979ee1c7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import json
from copy import deepcopy
from datetime import timedelta
from uuid import uuid4
import pytz
from confluent_kafka import Producer
from dateutil.parser import parse as parse_date
from django.conf import settings
from django.test.utils import override_settings
from exam... | 35.927835 | 100 | 0.649211 | from __future__ import absolute_import
import json
from copy import deepcopy
from datetime import timedelta
from uuid import uuid4
import pytz
from confluent_kafka import Producer
from dateutil.parser import parse as parse_date
from django.conf import settings
from django.test.utils import override_settings
from exam... | true | true |
1c16308479550dd25d14b7e81616042f7759a440 | 3,590 | py | Python | 0.13/_downloads/plot_compute_rt_decoder.py | drammock/mne-tools.github.io | 5d3a104d174255644d8d5335f58036e32695e85d | [
"BSD-3-Clause"
] | 4 | 2017-10-25T18:42:30.000Z | 2019-06-15T06:48:10.000Z | examples/realtime/plot_compute_rt_decoder.py | alexandrebarachant/mne-python | b54e38c9bbac38c6f53747075b5bad2936fbc5b9 | [
"BSD-3-Clause"
] | 2 | 2019-08-14T06:21:15.000Z | 2020-10-29T19:54:56.000Z | examples/realtime/plot_compute_rt_decoder.py | alexandrebarachant/mne-python | b54e38c9bbac38c6f53747075b5bad2936fbc5b9 | [
"BSD-3-Clause"
] | 1 | 2020-03-05T16:14:37.000Z | 2020-03-05T16:14:37.000Z | """
=======================
Decoding real-time data
=======================
Supervised machine learning applied to MEG data in sensor space.
Here the classifier is updated every 5 trials and the decoding
accuracy is plotted
"""
# Authors: Mainak Jas <mainak@neuro.hut.fi>
#
# License: BSD (3-clause)
import numpy as np... | 31.491228 | 76 | 0.648468 |
import numpy as np
import matplotlib.pyplot as plt
import mne
from mne.realtime import MockRtClient, RtEpochs
from mne.datasets import sample
print(__doc__)
data_path = sample.data_path()
raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'
raw = mne.io.read_raw_fif(raw_fname, preload=True)
tmin, ... | true | true |
1c1630f9e9402f4665cb000f7ec2a798121b9710 | 12,376 | py | Python | qiskit_finance/circuit/library/probability_distributions/normal.py | ahmadjubair33/qiskit-finance | 63822defdc5d12798009c7d98e82f515ca81249b | [
"Apache-2.0"
] | null | null | null | qiskit_finance/circuit/library/probability_distributions/normal.py | ahmadjubair33/qiskit-finance | 63822defdc5d12798009c7d98e82f515ca81249b | [
"Apache-2.0"
] | null | null | null | qiskit_finance/circuit/library/probability_distributions/normal.py | ahmadjubair33/qiskit-finance | 63822defdc5d12798009c7d98e82f515ca81249b | [
"Apache-2.0"
] | 1 | 2022-03-24T04:56:22.000Z | 2022-03-24T04:56:22.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2022.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 43.886525 | 103 | 0.558258 |
from typing import Tuple, Union, List, Optional, Any
import numpy as np
from qiskit.circuit import QuantumCircuit
class NormalDistribution(QuantumCircuit):
def __init__(
self,
num_qubits: Union[int, List[int]],
mu: Optional[Union[float, List[float]]] = None,
sigma: Optional[Unio... | true | true |
1c1631c2e36ea029b160553b0f145fdda238467b | 1,352 | py | Python | google_drive_downloader.py | thinkAmi/ipa_issues_model_by_doc2vec | 8fd2c7f48c7342fd185b8f4e4bd4ed2ae0447fa4 | [
"MIT"
] | null | null | null | google_drive_downloader.py | thinkAmi/ipa_issues_model_by_doc2vec | 8fd2c7f48c7342fd185b8f4e4bd4ed2ae0447fa4 | [
"MIT"
] | null | null | null | google_drive_downloader.py | thinkAmi/ipa_issues_model_by_doc2vec | 8fd2c7f48c7342fd185b8f4e4bd4ed2ae0447fa4 | [
"MIT"
] | null | null | null | import pathlib
from googleapiclient.http import MediaIoBaseDownload
from google_drive_utils import get_google_drive_service, list_files
# Googleドライブ上のディレクトリ名
GOOGLE_DRIVE_DIRECTORY_NAME = 'ipa2'
def main():
service = get_google_drive_service()
download(service, 'ap')
download(service, 'koudo')
def do... | 31.44186 | 97 | 0.657544 | import pathlib
from googleapiclient.http import MediaIoBaseDownload
from google_drive_utils import get_google_drive_service, list_files
GOOGLE_DRIVE_DIRECTORY_NAME = 'ipa2'
def main():
service = get_google_drive_service()
download(service, 'ap')
download(service, 'koudo')
def download(service, issue_... | true | true |
1c1633412d12c1b8a4ec53dc47ec7f6624440098 | 357 | py | Python | testingsqlserverdb.py | wajahatahmed245/python-flask-boilerplate | 671298eb25dc3de0673b7a2d6d457f701014d557 | [
"MIT"
] | null | null | null | testingsqlserverdb.py | wajahatahmed245/python-flask-boilerplate | 671298eb25dc3de0673b7a2d6d457f701014d557 | [
"MIT"
] | null | null | null | testingsqlserverdb.py | wajahatahmed245/python-flask-boilerplate | 671298eb25dc3de0673b7a2d6d457f701014d557 | [
"MIT"
] | null | null | null | import pyodbc
cnxn = pyodbc.connect("Driver={SQL Server Native Client 11.0};"
"Server=.;"
"Database=sampleQueryDb;"
"Trusted_Connection=yes;")
cursor = cnxn.cursor()
cursor.execute('SELECT CONVERT(varchar,DateInserted)as date,id,nameP,email,GenderId from tablePerson ')
#thelist=list()
f=cursor.fetchall()
#for row... | 18.789474 | 104 | 0.728291 | import pyodbc
cnxn = pyodbc.connect("Driver={SQL Server Native Client 11.0};"
"Server=.;"
"Database=sampleQueryDb;"
"Trusted_Connection=yes;")
cursor = cnxn.cursor()
cursor.execute('SELECT CONVERT(varchar,DateInserted)as date,id,nameP,email,GenderId from tablePerson ')
f=cursor.fetchall()
| true | true |
1c1633eaa66a871f1bf4d34e2dae971fa7c9c9f0 | 720 | py | Python | yolo_eval.py | divyanshrm/yolo_implementation | bb94246972ef018289f8254b4abec5c53c1413ce | [
"MIT"
] | null | null | null | yolo_eval.py | divyanshrm/yolo_implementation | bb94246972ef018289f8254b4abec5c53c1413ce | [
"MIT"
] | null | null | null | yolo_eval.py | divyanshrm/yolo_implementation | bb94246972ef018289f8254b4abec5c53c1413ce | [
"MIT"
] | null | null | null | def yolo_eval(yolo_outputs, image_shape = (720., 1280.), max_boxes=10, score_threshold=.6, iou_threshold=.5):
Converts the output of YOLO encoding (a lot of boxes) to predicted boxes along with their scores, box coordinates and classes.
box_confidence, box_xy, box_wh, box_class_... | 32.727273 | 131 | 0.697222 | def yolo_eval(yolo_outputs, image_shape = (720., 1280.), max_boxes=10, score_threshold=.6, iou_threshold=.5):
Converts the output of YOLO encoding (a lot of boxes) to predicted boxes along with their scores, box coordinates and classes.
box_confidence, box_xy, box_wh, box_class_... | false | true |
1c163500e7bf64bb90bf6382779c60067c5966d8 | 7,108 | py | Python | WebUtils/HTTPStatusCodes.py | PeaceWorksTechnologySolutions/w4py | 74f5a03a63f1a93563502b908474aefaae2abda2 | [
"MIT"
] | null | null | null | WebUtils/HTTPStatusCodes.py | PeaceWorksTechnologySolutions/w4py | 74f5a03a63f1a93563502b908474aefaae2abda2 | [
"MIT"
] | null | null | null | WebUtils/HTTPStatusCodes.py | PeaceWorksTechnologySolutions/w4py | 74f5a03a63f1a93563502b908474aefaae2abda2 | [
"MIT"
] | null | null | null | """HTTPStatusCodes.py
Dictionary of HTTP status codes (see RFC2616, section 10).
"""
import re
HTTPStatusCodeList = [
(100, 'CONTINUE', 'The client can continue.'),
(101, 'SWITCHING_PROTOCOLS', 'The server is switching protocols according to Upgrade header.'),
(200, 'O... | 71.08 | 238 | 0.654333 | """HTTPStatusCodes.py
Dictionary of HTTP status codes (see RFC2616, section 10).
"""
import re
HTTPStatusCodeList = [
(100, 'CONTINUE', 'The client can continue.'),
(101, 'SWITCHING_PROTOCOLS', 'The server is switching protocols according to Upgrade header.'),
(200, 'O... | false | true |
1c163614ee4be662f7be816e5ea85b7a1b1ee3e5 | 5,163 | py | Python | djangosaml2/views.py | mz-techops/banhammer | 02476db3d2bb617dbe50827687065fbea7553caf | [
"BSD-3-Clause"
] | 3 | 2018-03-09T23:29:25.000Z | 2020-11-25T15:34:13.000Z | djangosaml2/views.py | whyallyn/banhammer | 59fc81b15d9950a7a40279a9d1df8101c58df569 | [
"BSD-3-Clause"
] | 3 | 2018-05-08T01:10:43.000Z | 2021-03-19T21:56:36.000Z | djangosaml2/views.py | whyallyn/banhammer | 59fc81b15d9950a7a40279a9d1df8101c58df569 | [
"BSD-3-Clause"
] | 2 | 2018-05-10T15:07:24.000Z | 2018-06-20T16:24:00.000Z | """Djangosaml2 Django views."""
from saml2 import BINDING_HTTP_POST, BINDING_HTTP_REDIRECT, entity
from saml2.client import Saml2Client
from saml2.config import Config
from django.conf import settings
from django.contrib.auth.models import (User, Group)
from django.contrib.auth import login
from django.core.urlresolve... | 35.122449 | 80 | 0.661825 | from saml2 import BINDING_HTTP_POST, BINDING_HTTP_REDIRECT, entity
from saml2.client import Saml2Client
from saml2.config import Config
from django.conf import settings
from django.contrib.auth.models import (User, Group)
from django.contrib.auth import login
from django.core.urlresolvers import reverse
from django.ht... | true | true |
1c16362305c575fb3e42ea801d75b8747fd23134 | 12,341 | py | Python | episodic_curiosity/environments/dmlab_utils.py | cclauss/episodic-curiosity | 3c406964473d98fb977b1617a170a447b3c548fd | [
"Apache-2.0"
] | 195 | 2019-02-21T18:47:39.000Z | 2022-03-29T14:09:36.000Z | episodic_curiosity/environments/dmlab_utils.py | cclauss/episodic-curiosity | 3c406964473d98fb977b1617a170a447b3c548fd | [
"Apache-2.0"
] | 12 | 2019-03-24T03:26:35.000Z | 2021-09-28T05:50:35.000Z | episodic_curiosity/environments/dmlab_utils.py | cclauss/episodic-curiosity | 3c406964473d98fb977b1617a170a447b3c548fd | [
"Apache-2.0"
] | 43 | 2019-02-25T14:48:08.000Z | 2022-01-16T11:36:49.000Z | # coding=utf-8
# Copyright 2019 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 34.09116 | 80 | 0.626773 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import os
import tempfile
from absl import flags
from episodic_curiosity import oracle
from third_party.baselines import logger
from third_party.baselines.bench import Monitor
from third_party.bas... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.