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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c16d5e1e4ca74a70aea487f58f53d740aacda9d | 82 | py | Python | admin/lib/extensions.py | sluggard6/bgirl | 3c9fa895189ef16442694830d0c05cf60ee5187b | [
"Apache-2.0"
] | null | null | null | admin/lib/extensions.py | sluggard6/bgirl | 3c9fa895189ef16442694830d0c05cf60ee5187b | [
"Apache-2.0"
] | null | null | null | admin/lib/extensions.py | sluggard6/bgirl | 3c9fa895189ef16442694830d0c05cf60ee5187b | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from flask_assets import Environment
assets = Environment() | 27.333333 | 36 | 0.731707 | from flask_assets import Environment
assets = Environment() | true | true |
1c16d5e88dde618000943f88a534f1483ad10381 | 329 | py | Python | libs/dtools/odc/dtools/__init__.py | robbibt/odc-tools | e2df2c9ef65dbd5652d97cd88617989b4b724814 | [
"Apache-2.0"
] | 1 | 2021-04-15T23:06:10.000Z | 2021-04-15T23:06:10.000Z | libs/dtools/odc/dtools/__init__.py | robbibt/odc-tools | e2df2c9ef65dbd5652d97cd88617989b4b724814 | [
"Apache-2.0"
] | null | null | null | libs/dtools/odc/dtools/__init__.py | robbibt/odc-tools | e2df2c9ef65dbd5652d97cd88617989b4b724814 | [
"Apache-2.0"
] | null | null | null | """ Dask Distributed Tools
- pool_broadcast
"""
from ._broadcast import (
pool_broadcast,
rio_activate,
rio_getenv,
)
from ._dask_stream import (
dask_compute_stream,
seq_to_bags,
)
__all__ = (
"pool_broadcast",
"rio_activate",
"rio_getenv",
"dask_compute_stream",
"seq_to_... | 13.708333 | 27 | 0.653495 |
from ._broadcast import (
pool_broadcast,
rio_activate,
rio_getenv,
)
from ._dask_stream import (
dask_compute_stream,
seq_to_bags,
)
__all__ = (
"pool_broadcast",
"rio_activate",
"rio_getenv",
"dask_compute_stream",
"seq_to_bags",
)
| true | true |
1c16d62663c21f3da8b06f9c0f5c34720aecb4c2 | 5,647 | py | Python | bigml/predicate.py | pertinkoira/python | c486060f7f7c79ef9f48ced567f118ac7aae3f84 | [
"Apache-2.0"
] | null | null | null | bigml/predicate.py | pertinkoira/python | c486060f7f7c79ef9f48ced567f118ac7aae3f84 | [
"Apache-2.0"
] | 3 | 2022-03-29T17:54:19.000Z | 2022-03-29T17:54:42.000Z | bigml/predicate.py | pertinkoira/python | c486060f7f7c79ef9f48ced567f118ac7aae3f84 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2013-2022 BigML
#
# 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 ... | 40.049645 | 79 | 0.538516 |
import re
from bigml.predicate_utils.utils import TM_TOKENS, TM_FULL_TERM, TM_ALL, \
FULL_TERM_PATTERN, OPERATOR_CODE
from bigml.predicate_utils.utils import apply_predicate
from bigml.util import plural
RELATIONS = {
'<=': 'no more than %s %s',
'>=': '%s %s at most',
'>': 'more than %s %s',
'<'... | true | true |
1c16d6f731cefdbded22320e1cd50b550ef2e30c | 1,760 | py | Python | Quiver/chat/consumers.py | BastaAditya/Quiver | a6d29ec67341bd9cdb8a193ce1efcfd699aa4a96 | [
"MIT"
] | 1 | 2020-07-22T18:51:16.000Z | 2020-07-22T18:51:16.000Z | Quiver/chat/consumers.py | BastaAditya/Quiver | a6d29ec67341bd9cdb8a193ce1efcfd699aa4a96 | [
"MIT"
] | 18 | 2020-02-13T23:04:20.000Z | 2021-03-31T19:25:43.000Z | Quiver/chat/consumers.py | BastaAditya/Quiver | a6d29ec67341bd9cdb8a193ce1efcfd699aa4a96 | [
"MIT"
] | 5 | 2020-06-11T17:28:20.000Z | 2021-12-20T18:36:04.000Z | # chat/consumers.py
from channels.generic.websocket import AsyncWebsocketConsumer
from channels.db import database_sync_to_async
import json
from .forms import ChatMessageForm
class ChatConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.room_name = self.scope["url_route"]["kwargs"]["room_name... | 35.2 | 87 | 0.655114 | from channels.generic.websocket import AsyncWebsocketConsumer
from channels.db import database_sync_to_async
import json
from .forms import ChatMessageForm
class ChatConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.room_name = self.scope["url_route"]["kwargs"]["room_name"]
self.room... | true | true |
1c16d6f99326f391f1fb2838b116dc4aedb60cd6 | 2,527 | py | Python | docs/examples/python_scripts/lmfit_lorentzian_and_backgd_fit.py | celinedurniak/test_nbsphinx | f4bf376b933d5958cb921965cfb1430926fb10a5 | [
"MIT"
] | null | null | null | docs/examples/python_scripts/lmfit_lorentzian_and_backgd_fit.py | celinedurniak/test_nbsphinx | f4bf376b933d5958cb921965cfb1430926fb10a5 | [
"MIT"
] | 4 | 2020-07-09T05:43:47.000Z | 2020-07-21T08:29:42.000Z | docs/examples/python_scripts/lmfit_lorentzian_and_backgd_fit.py | celinedurniak/test_nbsphinx | f4bf376b933d5958cb921965cfb1430926fb10a5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# import python modules for plotting, fitting
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
# required imports from lmfit
from lmfit import Model
# import model from QENS library
import QENSmodels
# Units of parameters for selected Q... | 28.393258 | 98 | 0.648595 |
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from lmfit import Model
import QENSmodels
dict_physical_units = {'omega': "1/ps",
'scale': "unit_of_signal/ps",
'center': "1/ps",
'hwhm': "1/ps"}
nb_point... | true | true |
1c16d850d2dd73d8058a68ee8bd00cde251b53b5 | 2,422 | py | Python | day10b.py | Jamibaraki/adventOfCode2017 | dd1518d12595dd2c2554af549f80a0be84a6ba8a | [
"MIT"
] | 2 | 2018-02-26T11:41:55.000Z | 2020-04-12T09:55:03.000Z | day10b.py | Jamibaraki/adventOfCode2017 | dd1518d12595dd2c2554af549f80a0be84a6ba8a | [
"MIT"
] | null | null | null | day10b.py | Jamibaraki/adventOfCode2017 | dd1518d12595dd2c2554af549f80a0be84a6ba8a | [
"MIT"
] | null | null | null | #Advent of Code '17
#Day 10b: Knot hash
#elements = [0,1,2,3,4]
elements = []
for x in range( 0,256):
elements.append( x )
#inputlengths = [1,2,3]
inputlengths = [76,1,88,148,166,217,130,0,128,254,16,2,130,71,255,229]
lengths = []
#convert input to ascii values, with commas in between
for x in range(0,len(... | 23.514563 | 80 | 0.552023 | #Day 10b: Knot hash
#elements = [0,1,2,3,4]
elements = []
for x in range( 0,256):
elements.append( x )
#inputlengths = [1,2,3]
inputlengths = [76,1,88,148,166,217,130,0,128,254,16,2,130,71,255,229]
lengths = []
#convert input to ascii values, with commas in between
for x in range(0,len(inputlengths) ):
... | true | true |
1c16da010e280c019bcc4f23647f4e2c0b44c762 | 1,000 | py | Python | Python/Curso em video/ex045.py | Erick-Paulino/exercicios-de-cursos | ed78087a27da359ee79fe6dae3ffd9393e7d5873 | [
"MIT"
] | null | null | null | Python/Curso em video/ex045.py | Erick-Paulino/exercicios-de-cursos | ed78087a27da359ee79fe6dae3ffd9393e7d5873 | [
"MIT"
] | null | null | null | Python/Curso em video/ex045.py | Erick-Paulino/exercicios-de-cursos | ed78087a27da359ee79fe6dae3ffd9393e7d5873 | [
"MIT"
] | null | null | null | '''Crie um programa que faça o computador jogar Jokenpô com você.'''
print('''suas opções:
[0] pedra
[1] papel
[2] tesoura''')
from random import randint
from time import sleep
itens = ('pedra', 'papel', 'tesoura')
comp = randint(0, 2)
jogador = int(input('qual a sua jogada? '))
print('JO')
sleep(1)
print('KEN')
sleep(... | 24.390244 | 68 | 0.586 | print('''suas opções:
[0] pedra
[1] papel
[2] tesoura''')
from random import randint
from time import sleep
itens = ('pedra', 'papel', 'tesoura')
comp = randint(0, 2)
jogador = int(input('qual a sua jogada? '))
print('JO')
sleep(1)
print('KEN')
sleep(1)
print('PO')
print('-=' * 13)
print(f'o computador jogou {itens[com... | true | true |
1c16da29d27f85773d52c94647ca8817bbe31ade | 1,924 | py | Python | test/functional/test_framework/bignum.py | btclambo/BitcoinLambo | fc823516765338f06bce5ad8c7e3a5d6fe90f22b | [
"MIT"
] | null | null | null | test/functional/test_framework/bignum.py | btclambo/BitcoinLambo | fc823516765338f06bce5ad8c7e3a5d6fe90f22b | [
"MIT"
] | null | null | null | test/functional/test_framework/bignum.py | btclambo/BitcoinLambo | fc823516765338f06bce5ad8c7e3a5d6fe90f22b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Big number routines.
This file is copied from python-bitcoinlambolib.
"""
import struct
# generic big endian MPI format
def bn_bytes(v, have_ext=False... | 19.632653 | 69 | 0.532744 |
import struct
def bn_bytes(v, have_ext=False):
ext = 0
if have_ext:
ext = 1
return ((v.bit_length()+7)//8) + ext
def bn2bin(v):
s = bytearray()
i = bn_bytes(v)
while i > 0:
s.append((v >> ((i-1) * 8)) & 0xff)
i -= 1
return s
def bin2bn(s):
l = 0
for ch i... | true | true |
1c16db1a9a447f5b3b20148fe79191bc23ded7b7 | 1,172 | py | Python | pytak/constants.py | aerial-defence/pytak | e20c2dedfee88489bf21ad931970c2cb982d72ed | [
"Apache-2.0"
] | null | null | null | pytak/constants.py | aerial-defence/pytak | e20c2dedfee88489bf21ad931970c2cb982d72ed | [
"Apache-2.0"
] | null | null | null | pytak/constants.py | aerial-defence/pytak | e20c2dedfee88489bf21ad931970c2cb982d72ed | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Python Team Awareness Kit (PyTAK) Module Constants."""
import logging
import os
__author__ = "Greg Albrecht W2GMD <oss@undef.net>"
__copyright__ = "Copyright 2022 Greg Albrecht"
__license__ = "Apache License, Version 2.0"
if bool(os.environ.get('DEBUG')):
LOG_LE... | 32.555556 | 89 | 0.712457 |
import logging
import os
__author__ = "Greg Albrecht W2GMD <oss@undef.net>"
__copyright__ = "Copyright 2022 Greg Albrecht"
__license__ = "Apache License, Version 2.0"
if bool(os.environ.get('DEBUG')):
LOG_LEVEL: int = logging.DEBUG
LOG_FORMAT: logging.Formatter = logging.Formatter(
('%(asctime)s py... | true | true |
1c16db92c9efda428f1a7eb2acdf6a5886e25847 | 6,280 | py | Python | shakenfist/daemons/net.py | fidoandfido/shakenfist | 18612b27649310fb2d6ea1b32dce89640e8c857d | [
"Apache-2.0"
] | null | null | null | shakenfist/daemons/net.py | fidoandfido/shakenfist | 18612b27649310fb2d6ea1b32dce89640e8c857d | [
"Apache-2.0"
] | null | null | null | shakenfist/daemons/net.py | fidoandfido/shakenfist | 18612b27649310fb2d6ea1b32dce89640e8c857d | [
"Apache-2.0"
] | null | null | null | import time
from shakenfist import config
from shakenfist.daemons import daemon
from shakenfist import db
from shakenfist import exceptions
from shakenfist import logutil
from shakenfist import net
from shakenfist.tasks import (DeployNetworkTask,
NetworkTask,
... | 39.006211 | 96 | 0.53535 | import time
from shakenfist import config
from shakenfist.daemons import daemon
from shakenfist import db
from shakenfist import exceptions
from shakenfist import logutil
from shakenfist import net
from shakenfist.tasks import (DeployNetworkTask,
NetworkTask,
... | true | true |
1c16dbef31905f0956dacadbea94b50b7f07e070 | 3,475 | py | Python | wadeem/wadeem/doctype/enroll_children/enroll_children.py | siddhantsinha-oodles/Wadeem-app | eee05dead7ccee8878cf3630d3cdf32adb155c7f | [
"MIT"
] | null | null | null | wadeem/wadeem/doctype/enroll_children/enroll_children.py | siddhantsinha-oodles/Wadeem-app | eee05dead7ccee8878cf3630d3cdf32adb155c7f | [
"MIT"
] | null | null | null | wadeem/wadeem/doctype/enroll_children/enroll_children.py | siddhantsinha-oodles/Wadeem-app | eee05dead7ccee8878cf3630d3cdf32adb155c7f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Siddhant and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import ast
from datetime import date
class EnrollChildren(Document):
pass
def create_invoice... | 33.737864 | 105 | 0.646043 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import ast
from datetime import date
class EnrollChildren(Document):
pass
def create_invoice(doc):
item = []
for val in doc.items:
item.append({
'doctype': 'Sales Invoice Item',
... | true | true |
1c16dc88660718d0d7945e31d7df3bb45050f451 | 3,708 | py | Python | corehq/apps/users/tests/fixture_status.py | andyasne/commcare-hq | c59a24e57bdd4d2536493f9ecdcc9906f4ae1b88 | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/apps/users/tests/fixture_status.py | andyasne/commcare-hq | c59a24e57bdd4d2536493f9ecdcc9906f4ae1b88 | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/apps/users/tests/fixture_status.py | andyasne/commcare-hq | c59a24e57bdd4d2536493f9ecdcc9906f4ae1b88 | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | from datetime import datetime
from django.test import TestCase
from mock import MagicMock
from corehq.apps.domain.models import Domain
from corehq.apps.domain.utils import clear_domain_names
from corehq.apps.fixtures.models import UserFixtureStatus, UserFixtureType
from corehq.apps.users.dbaccessors import delete_al... | 39.870968 | 112 | 0.728425 | from datetime import datetime
from django.test import TestCase
from mock import MagicMock
from corehq.apps.domain.models import Domain
from corehq.apps.domain.utils import clear_domain_names
from corehq.apps.fixtures.models import UserFixtureStatus, UserFixtureType
from corehq.apps.users.dbaccessors import delete_al... | true | true |
1c16dd2a32d2383fa30a101fb9f4ff6302f3be5d | 4,121 | py | Python | azure-quantum/azure/quantum/target/target.py | AnudeepGunukula/qdk-python | 3a1f556d2d0e41fc1f4dc1dd0a9b79b57b989e6d | [
"MIT"
] | 3 | 2021-09-08T08:51:45.000Z | 2021-09-08T08:52:27.000Z | azure-quantum/azure/quantum/target/target.py | AnudeepGunukula/qdk-python | 3a1f556d2d0e41fc1f4dc1dd0a9b79b57b989e6d | [
"MIT"
] | null | null | null | azure-quantum/azure/quantum/target/target.py | AnudeepGunukula/qdk-python | 3a1f556d2d0e41fc1f4dc1dd0a9b79b57b989e6d | [
"MIT"
] | null | null | null | ##
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
##
import abc
from typing import Any, Dict
from azure.quantum._client.models import TargetStatus
from azure.quantum.workspace import Workspace
from azure.quantum.job.job import Job
class Target(abc.ABC):
"""Azure Qua... | 31.458015 | 80 | 0.621694 | import abc
from typing import Any, Dict
from azure.quantum._client.models import TargetStatus
from azure.quantum.workspace import Workspace
from azure.quantum.job.job import Job
class Target(abc.ABC):
target_names = ()
provider_id = ""
def __init__(
self,
workspace: Workspace,
... | true | true |
1c16dd56e90e2aaaca14bfc93d7afd7b7011077e | 3,680 | py | Python | torch_geometric/datasets/geometry.py | NucciTheBoss/pytorch_geometric | e220a2c08fa1b2f1672d616c22eac2a67b5c8967 | [
"MIT"
] | 2,350 | 2021-09-12T08:32:50.000Z | 2022-03-31T18:09:36.000Z | torch_geometric/datasets/geometry.py | NucciTheBoss/pytorch_geometric | e220a2c08fa1b2f1672d616c22eac2a67b5c8967 | [
"MIT"
] | 588 | 2021-09-12T08:49:08.000Z | 2022-03-31T21:02:13.000Z | torch_geometric/datasets/geometry.py | NucciTheBoss/pytorch_geometric | e220a2c08fa1b2f1672d616c22eac2a67b5c8967 | [
"MIT"
] | 505 | 2021-09-13T13:13:32.000Z | 2022-03-31T15:54:00.000Z | import glob
import os
import os.path as osp
from typing import Callable, List, Optional
import torch
from torch_geometric.data import InMemoryDataset, download_url, extract_zip
from torch_geometric.io import read_off
class GeometricShapes(InMemoryDataset):
r"""Synthetic dataset of various geometric shapes like ... | 40 | 79 | 0.644837 | import glob
import os
import os.path as osp
from typing import Callable, List, Optional
import torch
from torch_geometric.data import InMemoryDataset, download_url, extract_zip
from torch_geometric.io import read_off
class GeometricShapes(InMemoryDataset):
url = 'https://github.com/Yannick-S/geometric_shapes/r... | true | true |
1c16ddad8d33741dba51a16413a03db7875bed83 | 1,895 | py | Python | django_tests/conftest.py | micro-fan/fan_tools | 6e146ac4bf6fbe5119a03eb931498c45776a8928 | [
"MIT"
] | 1 | 2021-12-29T19:27:34.000Z | 2021-12-29T19:27:34.000Z | django_tests/conftest.py | micro-fan/fan_tools | 6e146ac4bf6fbe5119a03eb931498c45776a8928 | [
"MIT"
] | 1 | 2021-10-30T18:47:05.000Z | 2021-10-30T18:47:05.000Z | django_tests/conftest.py | micro-fan/fan_tools | 6e146ac4bf6fbe5119a03eb931498c45776a8928 | [
"MIT"
] | null | null | null | import os
import time
from contextlib import suppress
import pytest
from fan_tools.unix import ExecError, succ, wait_socket
def create_database():
print('Create database')
c = 0
while c < 30:
try:
succ('echo create database plugin | '
'PGPASSWORD=password psql -h loc... | 27.071429 | 78 | 0.618997 | import os
import time
from contextlib import suppress
import pytest
from fan_tools.unix import ExecError, succ, wait_socket
def create_database():
print('Create database')
c = 0
while c < 30:
try:
succ('echo create database plugin | '
'PGPASSWORD=password psql -h loc... | true | true |
1c16de04266d4def8426178b0b39dff04c3b8de8 | 60 | py | Python | qq_bot_service/plugin/private_message_plugin/test_plugin/__init__.py | HynemanKan/qq_bot | 3bca4cbeabee4dec6647a281a08184add9647dcb | [
"MIT"
] | 23 | 2019-11-05T14:08:09.000Z | 2022-02-21T13:07:28.000Z | qq_bot_service/plugin/private_message_plugin/test_plugin/__init__.py | HynemanKan/qq_bot | 3bca4cbeabee4dec6647a281a08184add9647dcb | [
"MIT"
] | null | null | null | qq_bot_service/plugin/private_message_plugin/test_plugin/__init__.py | HynemanKan/qq_bot | 3bca4cbeabee4dec6647a281a08184add9647dcb | [
"MIT"
] | 6 | 2020-06-03T15:34:03.000Z | 2021-11-16T00:22:16.000Z | from .app import blueprint,handle,re_str,sample_active_word
| 30 | 59 | 0.866667 | from .app import blueprint,handle,re_str,sample_active_word
| true | true |
1c16dedecf088c0a0d3305d4c71fa00d25dab16d | 1,502 | py | Python | spectrochempy/core/writers/writematlab.py | spectrochempy/spectrochempy | 829b290f465e630078785e303dbab197cd78b815 | [
"Apache-2.0",
"CECILL-B",
"BSD-3-Clause"
] | 44 | 2020-05-14T01:56:40.000Z | 2022-03-23T11:16:30.000Z | spectrochempy/core/writers/writematlab.py | spectrochempy/spectrochempy | 829b290f465e630078785e303dbab197cd78b815 | [
"Apache-2.0",
"CECILL-B",
"BSD-3-Clause"
] | 210 | 2020-05-22T17:33:22.000Z | 2022-03-20T16:50:30.000Z | spectrochempy/core/writers/writematlab.py | spectrochempy/spectrochempy | 829b290f465e630078785e303dbab197cd78b815 | [
"Apache-2.0",
"CECILL-B",
"BSD-3-Clause"
] | 9 | 2020-05-16T15:36:02.000Z | 2022-03-23T11:16:56.000Z | # -*- coding: utf-8 -*-
# ======================================================================================================================
# Copyright (©) 2015-2022 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France. =
# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See ful... | 29.45098 | 121 | 0.474035 |
from spectrochempy.core.writers.exporter import Exporter, exportermethod
__all__ = ["write_matlab", "write_mat"]
__dataset_methods__ = __all__
def write_matlab(*args, **kwargs):
exporter = Exporter()
kwargs["filetypes"] = ["MATLAB files (*.mat)"]
kwargs["suffix"] = ".mat"
return exporter(*args, **k... | true | true |
1c16df5d763eb3ac4192738889d764b0e7ae9904 | 1,245 | py | Python | resolwe_bio/kb/tests/test_import_kb.py | JureZmrzlikar/resolwe-bio | 54cde9b293abebad2db0564c9fefa33d6d2fe835 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/kb/tests/test_import_kb.py | JureZmrzlikar/resolwe-bio | 54cde9b293abebad2db0564c9fefa33d6d2fe835 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/kb/tests/test_import_kb.py | JureZmrzlikar/resolwe-bio | 54cde9b293abebad2db0564c9fefa33d6d2fe835 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=missing-docstring
import os
import mock
from django.core.management import call_command
from django.test import TestCase
from resolwe_bio.utils.test import TEST_FILES_DIR
class ImportKnowledgeBaseTestCase(TestCase):
@mock.patch('resolwe_bio.kb.management.commands.insert_features.logger')
... | 44.464286 | 101 | 0.759839 | import os
import mock
from django.core.management import call_command
from django.test import TestCase
from resolwe_bio.utils.test import TEST_FILES_DIR
class ImportKnowledgeBaseTestCase(TestCase):
@mock.patch('resolwe_bio.kb.management.commands.insert_features.logger')
def test_insert_features(self, mock_... | true | true |
1c16df67b33ace5532702efebcf68ce00410c921 | 3,386 | py | Python | src/radical/pilot/agent/launch_method/ssh.py | radical-cybertools/radical.pilot | 4ce3efbf3e2f045b5c48fb848e9f65f9f5ea17e9 | [
"MIT"
] | 47 | 2015-03-16T01:08:11.000Z | 2022-02-02T10:36:39.000Z | src/radical/pilot/agent/launch_method/ssh.py | radical-cybertools/radical.pilot | 4ce3efbf3e2f045b5c48fb848e9f65f9f5ea17e9 | [
"MIT"
] | 1,856 | 2015-01-02T09:32:20.000Z | 2022-03-31T21:45:06.000Z | src/radical/pilot/agent/launch_method/ssh.py | radical-cybertools/radical.pilot | 4ce3efbf3e2f045b5c48fb848e9f65f9f5ea17e9 | [
"MIT"
] | 28 | 2015-06-10T18:15:14.000Z | 2021-11-07T04:36:45.000Z |
__copyright__ = "Copyright 2016, http://radical.rutgers.edu"
__license__ = "MIT"
import os
import radical.utils as ru
from .base import LaunchMethod
# ------------------------------------------------------------------------------
#
class SSH(LaunchMethod):
# -----------------------------------------------... | 26.248062 | 80 | 0.413467 |
__copyright__ = "Copyright 2016, http://radical.rutgers.edu"
__license__ = "MIT"
import os
import radical.utils as ru
from .base import LaunchMethod
class SSH(LaunchMethod):
def __init__(self, name, lm_cfg, rm_info, log, prof):
LaunchMethod.__init__(self, name, lm_cfg, rm_info, log, prof)... | true | true |
1c16dfad422375f59c9a20a8207244b30ee69b45 | 2,560 | py | Python | sdk/compute/azure-mgmt-avs/setup.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-avs/setup.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-avs/setup.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 34.133333 | 91 | 0.602344 |
import re
import os.path
from io import open
from setuptools import find_packages, setup
PACKAGE_NAME = "azure-mgmt-avs"
PACKAGE_PPRINT_NAME = "Avs Management"
package_folder_path = PACKAGE_NAME.replace('-', '/')
namespace_name = PACKAGE_NAME.replace('-', '.')
with open(os.path.join(package_folder_path, 'version.... | true | true |
1c16dfb62940bc155fa41b6567ad4f6260c3e8e2 | 273 | py | Python | docker2/examples/example_1.py | promitray/Climate_change | c6f56706a8b2a10ca7c163a29983a54f618a4d66 | [
"MIT"
] | null | null | null | docker2/examples/example_1.py | promitray/Climate_change | c6f56706a8b2a10ca7c163a29983a54f618a4d66 | [
"MIT"
] | null | null | null | docker2/examples/example_1.py | promitray/Climate_change | c6f56706a8b2a10ca7c163a29983a54f618a4d66 | [
"MIT"
] | null | null | null | import requests
from datetime import datetime
import json
url = 'http://127.0.0.1:8080/Weather'
body = {
'start_date':str(datetime(2000, 1, 1)),
'limit_number': 1
}
response = requests.get(url, params = body)
res=response.json()
print (json.loads(res['result']))
| 16.058824 | 43 | 0.688645 | import requests
from datetime import datetime
import json
url = 'http://127.0.0.1:8080/Weather'
body = {
'start_date':str(datetime(2000, 1, 1)),
'limit_number': 1
}
response = requests.get(url, params = body)
res=response.json()
print (json.loads(res['result']))
| true | true |
1c16e0426ec797bc07f8d1405db84b7e11e7769a | 3,774 | py | Python | videos_to_sound.py | hai-labs/kinetics-downloader | 688801287409890abdf1dc62fc01b76d6d098e66 | [
"MIT"
] | null | null | null | videos_to_sound.py | hai-labs/kinetics-downloader | 688801287409890abdf1dc62fc01b76d6d098e66 | [
"MIT"
] | null | null | null | videos_to_sound.py | hai-labs/kinetics-downloader | 688801287409890abdf1dc62fc01b76d6d098e66 | [
"MIT"
] | null | null | null | import argparse, json
import lib.config as config
import lib.parallel_to_sound as parallel
def process_category(category, num_workers, failed_save_file, no_sound_save_file):
"""
Extract sounds for a category.
:param category: Category name.
:param num_workers: Number of worker processes... | 38.510204 | 122 | 0.701113 | import argparse, json
import lib.config as config
import lib.parallel_to_sound as parallel
def process_category(category, num_workers, failed_save_file, no_sound_save_file):
with open(config.CATEGORIES_PATH, "r") as file:
categories = json.load(file)
if category not in categories:
raise ValueError("Cate... | true | true |
1c16e080bd4a8530def3a5678c4c705a1c24a290 | 2,435 | py | Python | examples/data/trees.py | chenyangh/pytorch-struct | 2c87ef20c615c27194f85723e78b9269e6c8da14 | [
"MIT"
] | null | null | null | examples/data/trees.py | chenyangh/pytorch-struct | 2c87ef20c615c27194f85723e78b9269e6c8da14 | [
"MIT"
] | null | null | null | examples/data/trees.py | chenyangh/pytorch-struct | 2c87ef20c615c27194f85723e78b9269e6c8da14 | [
"MIT"
] | null | null | null | from torchtext.legacy import data
import torch
class ConllXDataset(data.Dataset):
def __init__(self, path, fields, encoding="utf-8", separator="\t", **kwargs):
examples = []
columns = [[], []]
column_map = {1: 0, 6: 1}
with open(path, encoding=encoding) as input_file:
f... | 36.343284 | 85 | 0.450103 | from torchtext.legacy import data
import torch
class ConllXDataset(data.Dataset):
def __init__(self, path, fields, encoding="utf-8", separator="\t", **kwargs):
examples = []
columns = [[], []]
column_map = {1: 0, 6: 1}
with open(path, encoding=encoding) as input_file:
f... | true | true |
1c16e0d0c28f1516b3010a66490d1502f507bd81 | 10,789 | py | Python | python/deltalake/schema.py | rtyler/delta.rs | b62d919c375accbd7e808655df4536d2f9227f9e | [
"Apache-2.0"
] | null | null | null | python/deltalake/schema.py | rtyler/delta.rs | b62d919c375accbd7e808655df4536d2f9227f9e | [
"Apache-2.0"
] | null | null | null | python/deltalake/schema.py | rtyler/delta.rs | b62d919c375accbd7e808655df4536d2f9227f9e | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List, Any, Optional
import json
import pyarrow
# TODO: implement this module in Rust land to avoid JSON serialization
# https://github.com/delta-io/delta-rs/issues/95
class DataType:
"""
Base class of all Delta data types.
"""
def __init__(self, type_class: str):
... | 33.299383 | 101 | 0.577996 | from typing import Dict, List, Any, Optional
import json
import pyarrow
class DataType:
def __init__(self, type_class: str):
self.type = type_class
def __str__(self) -> str:
return f"DataType({self.type})"
def __repr__(self) -> str:
return self.__str__()
def __eq__(self... | true | true |
1c16e159c20763231c94843e2f640c1cb5149057 | 908 | py | Python | Scripts/simulation/adoption/adoption_commands.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/adoption/adoption_commands.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/adoption/adoption_commands.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\adoption\adoption_commands.py
# Compiled at: 2017-09-14 20:43:34
# Size of source mod 2**32: 832 byt... | 50.444444 | 107 | 0.789648 | from server_commands.argument_helpers import OptionalSimInfoParam, get_optional_target
from sims4.commands import CommandType
import services, sims4.commands
@sims4.commands.Command('adoption.remove_sim_info', command_type=(CommandType.Live))
def remove_sim_info(opt_sim: OptionalSimInfoParam=None, _connection=None):
... | true | true |
1c16e28583ad1a8d10b85f5486d00f8fea707571 | 58,851 | py | Python | src/sage/symbolic/relation.py | velasjk3/SageMath | 7fb1c29714fb7c9b93e640e658586a664f939791 | [
"BSL-1.0"
] | null | null | null | src/sage/symbolic/relation.py | velasjk3/SageMath | 7fb1c29714fb7c9b93e640e658586a664f939791 | [
"BSL-1.0"
] | null | null | null | src/sage/symbolic/relation.py | velasjk3/SageMath | 7fb1c29714fb7c9b93e640e658586a664f939791 | [
"BSL-1.0"
] | null | null | null | r"""
Symbolic Equations and Inequalities
Sage can solve symbolic equations and inequalities. For
example, we derive the quadratic formula as follows::
sage: a,b,c = var('a,b,c')
sage: qe = (a*x^2 + b*x + c == 0)
sage: qe
a*x^2 + b*x + c == 0
sage: print(solve(qe, x))
[
x == -1/2*(b + sqrt(... | 32.07139 | 265 | 0.546363 |
import operator
def test_relation_maxima(relation):
m = relation._maxima_()
if repr(m) in ['0=0']:
return True
elif repr(m) in ['0#0', '1#1']:
return False
if relation.operator() == operator.eq: try:
s = m.parent()._eval_line('is (equal(%s,%s))'%(repr(m.lhs()... | true | true |
1c16e5b30395a2a4a5ec358e34b0d85ce8ebaa02 | 22,200 | py | Python | h2o-py/dynamic_tests/testdir_algos/naivebayes/pyunit_naivebayes_gridsearch_over_all_params_large.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2 | 2018-09-20T03:28:46.000Z | 2018-12-06T21:39:29.000Z | h2o-py/dynamic_tests/testdir_algos/naivebayes/pyunit_naivebayes_gridsearch_over_all_params_large.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2 | 2021-06-02T02:24:03.000Z | 2021-11-15T17:51:49.000Z | h2o-py/dynamic_tests/testdir_algos/naivebayes/pyunit_naivebayes_gridsearch_over_all_params_large.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 1 | 2020-04-17T13:06:26.000Z | 2020-04-17T13:06:26.000Z | from __future__ import print_function
import sys
import random
import os
from builtins import range
import time
import json
sys.path.insert(1, "../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.naive_bayes import H2ONaiveBayesEstimator
from h2o.grid.grid_search import H2OGridSearch
class Tes... | 56.345178 | 120 | 0.653288 | from __future__ import print_function
import sys
import random
import os
from builtins import range
import time
import json
sys.path.insert(1, "../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.naive_bayes import H2ONaiveBayesEstimator
from h2o.grid.grid_search import H2OGridSearch
class Tes... | true | true |
1c16e60c9fe723133493dba1f1bd9b41c75f4066 | 602 | py | Python | var/spack/repos/builtin/packages/perl-devel-globaldestruction/package.py | whitfin/spack | aabd2be31a511d0e00c1017f7311a421659319d9 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 3 | 2019-06-27T13:26:50.000Z | 2019-07-01T16:24:54.000Z | var/spack/repos/builtin/packages/perl-devel-globaldestruction/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 75 | 2016-07-27T11:43:00.000Z | 2020-12-08T15:56:53.000Z | var/spack/repos/builtin/packages/perl-devel-globaldestruction/package.py | openbiox/spack | bb6ec7fb40c14b37e094a860e3625af53f633174 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 8 | 2015-10-16T13:51:49.000Z | 2021-10-18T13:58:03.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PerlDevelGlobaldestruction(PerlPackage):
"""Makes Perl's global destruction less tricky to... | 37.625 | 106 | 0.752492 |
from spack import *
class PerlDevelGlobaldestruction(PerlPackage):
homepage = "http://search.cpan.org/~haarg/Devel-GlobalDestruction-0.14/lib/Devel/GlobalDestruction.pm"
url = "http://search.cpan.org/CPAN/authors/id/H/HA/HAARG/Devel-GlobalDestruction-0.14.tar.gz"
version('0.14', '24221ba322cf2dc46... | true | true |
1c16e69812a5c1a4bcfe3f0fcc65252a518bcc02 | 5,047 | py | Python | scripts/cleanup/unused_compilation.py | BreakerOfThings/o3de | f4c59f868c726470ec910623facd836047d059c3 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-28T08:06:58.000Z | 2022-03-28T08:06:58.000Z | scripts/cleanup/unused_compilation.py | BreakerOfThings/o3de | f4c59f868c726470ec910623facd836047d059c3 | [
"Apache-2.0",
"MIT"
] | null | null | null | scripts/cleanup/unused_compilation.py | BreakerOfThings/o3de | f4c59f868c726470ec910623facd836047d059c3 | [
"Apache-2.0",
"MIT"
] | null | null | null | #
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import argparse
import fnmatch
import os
import shutil
import sys
sys.path.append(os.path.join(os.path.dir... | 37.110294 | 153 | 0.62552 |
import argparse
import fnmatch
import os
import shutil
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../build'))
import ci_build
EXTENSIONS_OF_INTEREST = ('.c', '.cc', '.cpp', '.cxx', '.h', '.hpp', '.hxx', '.inl')
EXCLUSIONS = (
'AZ_DECLARE_MODULE_CLASS(',
'REGISTER_QT_... | true | true |
1c16e6c6a5f6e98e2a6ff6ad55221b94f8726d76 | 126 | py | Python | myweb/myproject/blacklist/admin.py | dchacca/DjangoOnline | be470e5784f71da367d987464f83dc8929ee2f70 | [
"MIT"
] | null | null | null | myweb/myproject/blacklist/admin.py | dchacca/DjangoOnline | be470e5784f71da367d987464f83dc8929ee2f70 | [
"MIT"
] | null | null | null | myweb/myproject/blacklist/admin.py | dchacca/DjangoOnline | be470e5784f71da367d987464f83dc8929ee2f70 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import BlackList
# Register your models here.
admin.site.register(BlackList)
| 15.75 | 32 | 0.801587 | from django.contrib import admin
from .models import BlackList
admin.site.register(BlackList)
| true | true |
1c16e6d27c6bd01cb28f07c984bb0a209219427f | 3,234 | py | Python | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/utils/crypto.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | null | null | null | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/utils/crypto.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | 10 | 2020-06-05T19:42:26.000Z | 2022-03-11T23:38:35.000Z | code/venv/lib/python3.6/site-packages/pgadmin4/pgadmin/utils/crypto.py | jhkuang11/UniTrade | 5f68b853926e167936b58c8543b8f95ebd6f5211 | [
"MIT"
] | null | null | null | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2017, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
#########################################################################
"""This File Provi... | 26.508197 | 76 | 0.627706 |
import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
padding_string = b'}'
def encrypt(plaintext, key):
iv = Random.new().read(AES.block_size)
cipher = AES.new(pad(key), AES.MODE_CFB, iv)
if hasattr(str, 'decode'):
plaintext = plaintext.encode('utf-8')
... | true | true |
1c16e876203448198342e223303f31a86b46e60e | 2,364 | py | Python | react-native-learnjavascript/learnjsru_parser/learnjsru_parser.py | gebeto/react-native-projects | aa28fd395b59b1020078ce7017683709d6406910 | [
"MIT"
] | null | null | null | react-native-learnjavascript/learnjsru_parser/learnjsru_parser.py | gebeto/react-native-projects | aa28fd395b59b1020078ce7017683709d6406910 | [
"MIT"
] | null | null | null | react-native-learnjavascript/learnjsru_parser/learnjsru_parser.py | gebeto/react-native-projects | aa28fd395b59b1020078ce7017683709d6406910 | [
"MIT"
] | null | null | null | import json
import requests
from bs4 import BeautifulSoup
learnjavascript = {}
base_url = "http://learn.javascript.ru"
file_url = "learnjsfiles"
try: os.mkdir(file_url)
except: pass
def downlaod_lection(url):
resp = requests.get(base_url + url).content
soup = BeautifulSoup(resp, 'html.parser')
resource = soup.fin... | 36.369231 | 385 | 0.682741 | import json
import requests
from bs4 import BeautifulSoup
learnjavascript = {}
base_url = "http://learn.javascript.ru"
file_url = "learnjsfiles"
try: os.mkdir(file_url)
except: pass
def downlaod_lection(url):
resp = requests.get(base_url + url).content
soup = BeautifulSoup(resp, 'html.parser')
resource = soup.fin... | false | true |
1c16e89cc35499c3e4f1e4f1f856360db98d1f03 | 1,439 | py | Python | ament_flake8/setup.py | ahcorde/ament_lint | 00ff5dee0406e00b48d37f464a6cb9183e84bdb1 | [
"Apache-2.0"
] | 1 | 2021-01-11T06:29:04.000Z | 2021-01-11T06:29:04.000Z | ament_flake8/setup.py | clalancette/ament_lint | 00ff5dee0406e00b48d37f464a6cb9183e84bdb1 | [
"Apache-2.0"
] | null | null | null | ament_flake8/setup.py | clalancette/ament_lint | 00ff5dee0406e00b48d37f464a6cb9183e84bdb1 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages
from setuptools import setup
package_name = 'ament_flake8'
setup(
name=package_name,
version='0.9.1',
packages=find_packages(exclude=['test']),
data_files=[
('share/' + package_name, ['package.xml']),
('share/ament_index/resource_index/packages',
... | 30.617021 | 75 | 0.633079 | from setuptools import find_packages
from setuptools import setup
package_name = 'ament_flake8'
setup(
name=package_name,
version='0.9.1',
packages=find_packages(exclude=['test']),
data_files=[
('share/' + package_name, ['package.xml']),
('share/ament_index/resource_index/packages',
... | true | true |
1c16e8da4e9418c6222e553ac2c67eeea39d6fa3 | 1,655 | py | Python | will_of_the_prophets/validators.py | craiga/will-of-the-prophets | d968fedcf382d26c07ecd2e9f6dc75e24a277883 | [
"MIT"
] | 20 | 2018-07-03T01:28:51.000Z | 2021-05-20T13:30:57.000Z | will_of_the_prophets/validators.py | craiga/will-of-the-prophets | d968fedcf382d26c07ecd2e9f6dc75e24a277883 | [
"MIT"
] | 511 | 2018-06-27T10:54:29.000Z | 2022-03-31T08:10:18.000Z | will_of_the_prophets/validators.py | craiga/will-of-the-prophets | d968fedcf382d26c07ecd2e9f6dc75e24a277883 | [
"MIT"
] | 6 | 2018-08-23T13:28:21.000Z | 2020-01-10T23:11:49.000Z | """Validators."""
import warnings
from datetime import datetime
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from will_of_the_prophets import models
def not_butthole_start_validator(va... | 29.553571 | 85 | 0.699094 |
import warnings
from datetime import datetime
from django.core import validators
from django.core.exceptions import ValidationError
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from will_of_the_prophets import models
def not_butthole_start_validator(value):
warnings... | true | true |
1c16e8fe16a2a4c36ec31d1ff2e056f2432f27a8 | 2,481 | py | Python | localytics/__init__.py | lexadavid/localytics | aafc8f2a121337bdf4d9dfadf1e65e9865c7d99a | [
"MIT"
] | 1 | 2018-06-21T08:02:06.000Z | 2018-06-21T08:02:06.000Z | localytics/__init__.py | lexadavid/localytics | aafc8f2a121337bdf4d9dfadf1e65e9865c7d99a | [
"MIT"
] | 1 | 2019-09-14T23:10:29.000Z | 2019-09-14T23:10:29.000Z | localytics/__init__.py | lexadavid/localytics | aafc8f2a121337bdf4d9dfadf1e65e9865c7d99a | [
"MIT"
] | null | null | null | import requests
import time
import os
import shutil
import gzip
from datetime import timedelta, datetime
from progressbar import ProgressBar
class Localytics():
def __init__(self, api_key, api_secret):
self.api_key = api_key
self.api_secret = api_secret
@staticmethod
def get_endpoints(app... | 42.050847 | 120 | 0.642483 | import requests
import time
import os
import shutil
import gzip
from datetime import timedelta, datetime
from progressbar import ProgressBar
class Localytics():
def __init__(self, api_key, api_secret):
self.api_key = api_key
self.api_secret = api_secret
@staticmethod
def get_endpoints(app... | true | true |
1c16e97dee1d8e3dc4b67618610461701d182a93 | 2,375 | py | Python | fsl/utils/parse_data.py | physimals/fslpy | 10dd3f996c79d402c65cf0af724b8b00082d5176 | [
"Apache-2.0"
] | 6 | 2018-04-18T03:42:50.000Z | 2021-11-20T18:46:37.000Z | fsl/utils/parse_data.py | physimals/fslpy | 10dd3f996c79d402c65cf0af724b8b00082d5176 | [
"Apache-2.0"
] | 13 | 2018-10-01T11:45:05.000Z | 2022-03-16T12:28:36.000Z | fsl/utils/parse_data.py | physimals/fslpy | 10dd3f996c79d402c65cf0af724b8b00082d5176 | [
"Apache-2.0"
] | 5 | 2017-12-09T09:02:17.000Z | 2021-11-15T16:55:30.000Z | #!/usr/bin/env python
#
# Support for neuroimage data in argparse
#
# Author: Michiel Cottaar <michiel.cottaar@ndcn.ox.ac.uk
#
"""This module contains support for neuroimaging data in argparse
Argparse is the built-in python library for resolving command line arguments.
The functions in this module can be passed on t... | 27.298851 | 99 | 0.693474 |
from fsl.data import image, gifti, vtk, atlases
from fsl.utils import path
import argparse
def Image(filename, *args, **kwargs):
try:
full_filename = image.addExt(filename)
except path.PathError as e:
raise argparse.ArgumentTypeError(*e.args)
return image.Image(full_filename, *args, **kw... | true | true |
1c16e9a73c297322d1bf16d719dc9a1f3366a036 | 257 | py | Python | src/playground/test_algo/normal/exchange.py | objcat/test-python | 97b3cb610a80b8e00b8a032ca94bb3fead4102fb | [
"MIT"
] | null | null | null | src/playground/test_algo/normal/exchange.py | objcat/test-python | 97b3cb610a80b8e00b8a032ca94bb3fead4102fb | [
"MIT"
] | null | null | null | src/playground/test_algo/normal/exchange.py | objcat/test-python | 97b3cb610a80b8e00b8a032ca94bb3fead4102fb | [
"MIT"
] | null | null | null | # description: exchange
# date: 2021/4/30 1:36 下午
# author: objcat
# version: 1.0
def exchange(a, b):
temp = a
a = b
b = temp
print(a)
print(b)
if __name__ == '__main__':
a = 1
b = 2
exchange(a, b)
print(a)
print(b) | 14.277778 | 26 | 0.533074 |
def exchange(a, b):
temp = a
a = b
b = temp
print(a)
print(b)
if __name__ == '__main__':
a = 1
b = 2
exchange(a, b)
print(a)
print(b) | true | true |
1c16e9e5d191bdc0543128c7825a570393de5191 | 1,240 | py | Python | 148.py | whoophee/DCP | ea023dc7c01a13ee17f7e9445c7a70a092025254 | [
"MIT"
] | 2 | 2018-07-29T18:39:15.000Z | 2020-09-02T16:28:36.000Z | 148.py | whoophee/DCP | ea023dc7c01a13ee17f7e9445c7a70a092025254 | [
"MIT"
] | null | null | null | 148.py | whoophee/DCP | ea023dc7c01a13ee17f7e9445c7a70a092025254 | [
"MIT"
] | null | null | null | # This problem was asked by Apple.
# Gray code is a binary code where each successive value differ in only one bit,
# as well as when wrapping around. Gray code is common in hardware so that we don't
# see temporary spurious values during transitions.
# Given a number of bits n, generate a possible gray code for it.
# ... | 47.692308 | 83 | 0.716935 | # see temporary spurious values during transitions.
# Given a number of bits n, generate a possible gray code for it.
# For example, for n = 2, one gray code would be [00, 01, 11, 10].
####
# The idea behind generating this sequence is pretty simple.
# 1. Generate this sequence for n-1 bits.
# 2. Add a '0' to the end o... | true | true |
1c16e9f4fbc2cc557c26dd2045e634092330c943 | 876 | py | Python | mouseloaf/plugin.py | jcostaroberts/mouseloaf | c4dc375da605b3ec8c6b221ca2f5bdaf8d7e2d7b | [
"Apache-2.0"
] | null | null | null | mouseloaf/plugin.py | jcostaroberts/mouseloaf | c4dc375da605b3ec8c6b221ca2f5bdaf8d7e2d7b | [
"Apache-2.0"
] | null | null | null | mouseloaf/plugin.py | jcostaroberts/mouseloaf | c4dc375da605b3ec8c6b221ca2f5bdaf8d7e2d7b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import imp
# Mostly lifted off Eli Bendersky
class PluginRegistry(type):
plugins = []
def __init__(cls, name, bases, attrs):
if "Base" not in name:
PluginRegistry.plugins.append(cls)
def load_plugins(plugin_dir, modules):
loaded = []
for root, dirs... | 31.285714 | 69 | 0.590183 |
import os
import imp
class PluginRegistry(type):
plugins = []
def __init__(cls, name, bases, attrs):
if "Base" not in name:
PluginRegistry.plugins.append(cls)
def load_plugins(plugin_dir, modules):
loaded = []
for root, dirs, files in os.walk(plugin_dir):
for filename in ... | true | true |
1c16ea4c5f97d28bf7c14e64362e22907da647c7 | 3,544 | py | Python | Natural Language Processing Bibliometrics/CrossRef_XML_mining.py | TabeaSonnenschein/Spatial-Agent-based-Modeling-of-Urban-Health-Interventions | 23a207fe74005e45e6349853cdde516ce66647e0 | [
"MIT"
] | 1 | 2021-06-10T06:17:08.000Z | 2021-06-10T06:17:08.000Z | Natural Language Processing Bibliometrics/CrossRef_XML_mining.py | TabeaSonnenschein/Spatial-Agent-based-Modeling-of-Urban-Health-Interventions | 23a207fe74005e45e6349853cdde516ce66647e0 | [
"MIT"
] | null | null | null | Natural Language Processing Bibliometrics/CrossRef_XML_mining.py | TabeaSonnenschein/Spatial-Agent-based-Modeling-of-Urban-Health-Interventions | 23a207fe74005e45e6349853cdde516ce66647e0 | [
"MIT"
] | null | null | null | import urllib.request
import os
import pandas as pd
import requests
import numpy as np
import itertools
import elsapy
os.chdir(r"C:\Users\Tabea\Documents\PhD EXPANSE\Literature\WOS_ModalChoice_Ref")
paper_DOIs = pd.read_csv("WOS_references_search5_metareviews_DOIs.csv")
print(paper_DOIs.iloc[:,0])
# ## Load configur... | 42.190476 | 135 | 0.61202 | import urllib.request
import os
import pandas as pd
import requests
import numpy as np
import itertools
import elsapy
os.chdir(r"C:\Users\Tabea\Documents\PhD EXPANSE\Literature\WOS_ModalChoice_Ref")
paper_DOIs = pd.read_csv("WOS_references_search5_metareviews_DOIs.csv")
print(paper_DOIs.iloc[:,0])
paperLinks = []
r... | true | true |
1c16eb1be5efa401448fc6c6c49d01b91881f5d4 | 9,836 | py | Python | DeepLearning/01-Backpropagation/BackpropagationMNIST.py | iOsnaaente/Faculdade_ECA-UFSM | aea8b8d66169b073c439b47ad990e45695cbe953 | [
"MIT"
] | null | null | null | DeepLearning/01-Backpropagation/BackpropagationMNIST.py | iOsnaaente/Faculdade_ECA-UFSM | aea8b8d66169b073c439b47ad990e45695cbe953 | [
"MIT"
] | null | null | null | DeepLearning/01-Backpropagation/BackpropagationMNIST.py | iOsnaaente/Faculdade_ECA-UFSM | aea8b8d66169b073c439b47ad990e45695cbe953 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from struct import unpack
def read_imgs(img_filename):
''' Esta função lê o arquivo de imagens
da base de dados MNIST
'''
# Abre o arquivo
img_file = open(img_filename,'rb')
# Lê o cabeçalho do arquivo
magic = unpack('>i', img_file.read(4))[0]
total = u... | 25.481865 | 125 | 0.652704 |
import numpy as np
from struct import unpack
def read_imgs(img_filename):
img_file = open(img_filename,'rb')
magic = unpack('>i', img_file.read(4))[0]
total = unpack('>i', img_file.read(4))[0]
height = unpack('>i', img_file.read(4))[0]
width = unpack('>i', img_file.read(4))[0]
if magic != 2051:... | true | true |
1c16eb26ab6c575e7308e513975d2e58e5abd77f | 44 | py | Python | language-python-test/test/features/exceptions/try_except_div_by_zero.py | wbadart/language-python | 6c048c215ff7fe4a5d5cc36ba3c17a666af74821 | [
"BSD-3-Clause"
] | 137 | 2015-02-13T21:03:23.000Z | 2021-11-24T03:53:55.000Z | language-python-test/test/features/exceptions/try_except_div_by_zero.py | wbadart/language-python | 6c048c215ff7fe4a5d5cc36ba3c17a666af74821 | [
"BSD-3-Clause"
] | 4 | 2015-04-01T13:49:13.000Z | 2019-07-09T19:28:56.000Z | language-python-test/test/features/exceptions/try_except_div_by_zero.py | wbadart/language-python | 6c048c215ff7fe4a5d5cc36ba3c17a666af74821 | [
"BSD-3-Clause"
] | 8 | 2015-04-25T03:47:52.000Z | 2019-07-27T06:33:56.000Z | try:
1 / 0
except:
print('caught it')
| 8.8 | 21 | 0.545455 | try:
1 / 0
except:
print('caught it')
| true | true |
1c16ec49cf35ec3a415eb045ac194c32ef2187d2 | 2,642 | py | Python | auth/tests/requests_tests/test_validate_register.py | exactpro/nostradamus | 80df847a012374ad2b702cc9f9c9cb46c1153ee7 | [
"Apache-2.0"
] | 25 | 2019-12-18T05:32:41.000Z | 2022-03-23T12:16:49.000Z | auth/tests/requests_tests/test_validate_register.py | Exactpro/nostradamus | 80df847a012374ad2b702cc9f9c9cb46c1153ee7 | [
"Apache-2.0"
] | 12 | 2018-12-24T14:56:50.000Z | 2019-11-29T16:53:49.000Z | auth/tests/requests_tests/test_validate_register.py | exactpro/nostradamus | 80df847a012374ad2b702cc9f9c9cb46c1153ee7 | [
"Apache-2.0"
] | 7 | 2019-12-18T05:32:43.000Z | 2021-08-18T05:27:04.000Z | import requests
import unittest
import pytest
from database import create_session
from models.User import User
@pytest.mark.usefixtures(
"test_user_1",
"host",
"register_url",
)
class TestRegister(unittest.TestCase):
def teardown_method(self, _):
with create_session() as db:
db.qu... | 34.311688 | 81 | 0.577593 | import requests
import unittest
import pytest
from database import create_session
from models.User import User
@pytest.mark.usefixtures(
"test_user_1",
"host",
"register_url",
)
class TestRegister(unittest.TestCase):
def teardown_method(self, _):
with create_session() as db:
db.qu... | true | true |
1c16ec897cdda6d701b4826f251175f9e562ede3 | 453 | py | Python | env/Lib/site-packages/plotly/validators/parcoords/line/_cmid.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/parcoords/line/_cmid.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/parcoords/line/_cmid.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class CmidValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmid", parent_name="parcoords.line", **kwargs):
super(CmidValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 34.846154 | 83 | 0.660044 | import _plotly_utils.basevalidators
class CmidValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="cmid", parent_name="parcoords.line", **kwargs):
super(CmidValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
1c16ecaf224eb70e73a02c47aca8d72378c458b2 | 454 | py | Python | faddr/__init__.py | kido5217/faddr | 116c789ac3985cc3f461203e249d8043dcb73428 | [
"MIT"
] | 1 | 2022-03-10T17:52:13.000Z | 2022-03-10T17:52:13.000Z | faddr/__init__.py | kido5217/faddr | 116c789ac3985cc3f461203e249d8043dcb73428 | [
"MIT"
] | 45 | 2021-08-08T15:23:42.000Z | 2022-03-28T20:23:57.000Z | faddr/__init__.py | kido5217/faddr | 116c789ac3985cc3f461203e249d8043dcb73428 | [
"MIT"
] | 1 | 2021-10-22T00:46:35.000Z | 2021-10-22T00:46:35.000Z | """Parse network devices' configuration and store in database."""
import sys
import os
from loguru import logger
from faddr.rancid import RancidDir
from faddr.device import Device
from faddr.device import CiscoIOSDevice
__version__ = "0.0.3"
__all__ = (
"RancidDir",
"Device",
"CiscoIOSDevice",
)
if os... | 16.814815 | 65 | 0.720264 |
import sys
import os
from loguru import logger
from faddr.rancid import RancidDir
from faddr.device import Device
from faddr.device import CiscoIOSDevice
__version__ = "0.0.3"
__all__ = (
"RancidDir",
"Device",
"CiscoIOSDevice",
)
if os.getenv("FADDR_DEBUG"):
LOG_LEVEL = "DEBUG"
else:
LOG_LEVE... | true | true |
1c16ed0a0c394eaa0123604c9c8da9711bb8f55f | 6,000 | py | Python | taxcalc_arp/taxcalc/tests/test_consumption.py | hdoupe/Tax-Cruncher-ARP | c8c960c085d0883915f99ac2ea4630c928af4c16 | [
"MIT"
] | 1 | 2021-10-01T14:22:32.000Z | 2021-10-01T14:22:32.000Z | taxcalc_arp/taxcalc/tests/test_consumption.py | hdoupe/Tax-Cruncher-ARP | c8c960c085d0883915f99ac2ea4630c928af4c16 | [
"MIT"
] | 1 | 2021-03-16T13:57:36.000Z | 2021-03-16T13:57:36.000Z | taxcalc_arp/taxcalc/tests/test_consumption.py | hdoupe/Tax-Cruncher-ARP | c8c960c085d0883915f99ac2ea4630c928af4c16 | [
"MIT"
] | 1 | 2021-03-16T13:44:38.000Z | 2021-03-16T13:44:38.000Z | # CODING-STYLE CHECKS:
# pycodestyle test_consumption.py
import numpy as np
import paramtools
import pytest
import copy
from taxcalc import Policy, Records, Calculator, Consumption
def test_year_consistency():
assert Consumption.JSON_START_YEAR == Policy.JSON_START_YEAR
assert Consumption.DEFAULT_NUM_YEARS =... | 41.37931 | 79 | 0.678167 |
import numpy as np
import paramtools
import pytest
import copy
from taxcalc import Policy, Records, Calculator, Consumption
def test_year_consistency():
assert Consumption.JSON_START_YEAR == Policy.JSON_START_YEAR
assert Consumption.DEFAULT_NUM_YEARS == Policy.DEFAULT_NUM_YEARS
def test_validity_of_consump... | true | true |
1c16ed114d6510da3735e731718ffcf331c8f2dd | 1,052 | py | Python | anomaly_detection/datasets/main.py | leggedrobotics/anomaly_navigation | e4d87a1b67904e0537de3fa4b3e53bc4932d1681 | [
"MIT"
] | 21 | 2020-01-14T19:05:14.000Z | 2022-02-03T11:12:26.000Z | anomaly_detection/datasets/main.py | leggedrobotics/anomaly_navigation | e4d87a1b67904e0537de3fa4b3e53bc4932d1681 | [
"MIT"
] | 1 | 2020-01-15T10:00:05.000Z | 2020-01-15T10:55:44.000Z | anomaly_detection/datasets/main.py | leggedrobotics/anomaly_navigation | e4d87a1b67904e0537de3fa4b3e53bc4932d1681 | [
"MIT"
] | 9 | 2020-01-14T19:04:46.000Z | 2021-11-14T13:42:56.000Z | from .selfsupervised_patches import SelfSupervisedDataset
def load_dataset(dataset_name, data_path, normal_class, cfg):
"""Loads the dataset."""
implemented_datasets = ('selfsupervised')
assert dataset_name in implemented_datasets
dataset = None
if dataset_name == 'selfsupervised':
data... | 42.08 | 82 | 0.492395 | from .selfsupervised_patches import SelfSupervisedDataset
def load_dataset(dataset_name, data_path, normal_class, cfg):
implemented_datasets = ('selfsupervised')
assert dataset_name in implemented_datasets
dataset = None
if dataset_name == 'selfsupervised':
dataset = SelfSupervisedDataset(r... | true | true |
1c16ee1249368b91d7fb65b56062730af9112837 | 2,174 | py | Python | chainer/training/extensions/warmup_shift.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 3,705 | 2017-06-01T07:36:12.000Z | 2022-03-30T10:46:15.000Z | chainer/training/extensions/warmup_shift.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 5,998 | 2017-06-01T06:40:17.000Z | 2022-03-08T01:42:44.000Z | chainer/training/extensions/warmup_shift.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 1,150 | 2017-06-02T03:39:46.000Z | 2022-03-29T02:29:32.000Z | from __future__ import division
from chainer.training import extension
class WarmupShift(extension.Extension):
"""Trainer extension to gradually initialize an optimizer attribute.
This extension changes an optimizer attribute evenly at the
beginning of one training.
For example, suppose that this ... | 36.847458 | 77 | 0.650414 | from __future__ import division
from chainer.training import extension
class WarmupShift(extension.Extension):
def __init__(self, attr, warmup_start, warmup_iter, init,
optimizer=None):
self._attr = attr
self._warmup_start = warmup_start
self._warmup_iter = warmup_iter
... | true | true |
1c16ef37513d6c618760b66bdb6d6503b6e4ee1f | 2,061 | py | Python | tests/test_connection.py | kokellab/valarpy | 86b3cba301689194768814d6a136b0c93650ca25 | [
"Apache-2.0"
] | null | null | null | tests/test_connection.py | kokellab/valarpy | 86b3cba301689194768814d6a136b0c93650ca25 | [
"Apache-2.0"
] | 46 | 2020-09-23T19:12:43.000Z | 2022-03-28T08:08:07.000Z | tests/test_connection.py | kokellab/valarpy | 86b3cba301689194768814d6a136b0c93650ca25 | [
"Apache-2.0"
] | null | null | null | import json
import os
from pathlib import Path
import pytest
from valarpy import *
CONFIG_PATH = Path(__file__).parent / "resources" / "connection.json"
CONFIG_DATA = json.loads(CONFIG_PATH.read_text(encoding="utf8"))
class TestModel:
def test_reconnect(self):
with Valar(CONFIG_PATH) as valar:
... | 30.308824 | 87 | 0.578845 | import json
import os
from pathlib import Path
import pytest
from valarpy import *
CONFIG_PATH = Path(__file__).parent / "resources" / "connection.json"
CONFIG_DATA = json.loads(CONFIG_PATH.read_text(encoding="utf8"))
class TestModel:
def test_reconnect(self):
with Valar(CONFIG_PATH) as valar:
... | true | true |
1c16ef89dae7f21913becb5f5fa04c4424196c23 | 1,417 | py | Python | alipay/aop/api/domain/AlipayMarketingRecruitEnrollQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayMarketingRecruitEnrollQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayMarketingRecruitEnrollQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayMarketingRecruitEnrollQueryModel(object):
def __init__(self):
self._enroll_id = None
self._out_biz_no = None
@property
def enroll_id(self):
return self._enr... | 25.303571 | 71 | 0.597742 | import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayMarketingRecruitEnrollQueryModel(object):
def __init__(self):
self._enroll_id = None
self._out_biz_no = None
@property
def enroll_id(self):
return self._enroll_id
@enroll_id.setter
def enroll_i... | true | true |
1c16ef9dc7b73a70b75dfd145215af28bf6cecbf | 1,299 | py | Python | doh/exceptions.py | ZhukovAlexander/aio-doh | 224782cc37c5a648f04ef861ebfd256c52c7eff3 | [
"Apache-2.0"
] | 13 | 2017-12-18T18:39:09.000Z | 2020-01-10T09:38:32.000Z | doh/exceptions.py | ZhukovAlexander/aio-doh | 224782cc37c5a648f04ef861ebfd256c52c7eff3 | [
"Apache-2.0"
] | null | null | null | doh/exceptions.py | ZhukovAlexander/aio-doh | 224782cc37c5a648f04ef861ebfd256c52c7eff3 | [
"Apache-2.0"
] | 1 | 2018-09-18T11:28:36.000Z | 2018-09-18T11:28:36.000Z |
__all__ = ['DNSException', 'FormErr', 'ServFail', 'NXDomain', 'NotImpl',
'Refused', 'YXDomain', 'XRRSet', 'NotAuth', 'NotZone', 'DOHException']
class DNSException(Exception):
@classmethod
def from_response(cls, response):
code = response['Status']
assert 1 <= code <= 9
ex... | 18.041667 | 81 | 0.618938 |
__all__ = ['DNSException', 'FormErr', 'ServFail', 'NXDomain', 'NotImpl',
'Refused', 'YXDomain', 'XRRSet', 'NotAuth', 'NotZone', 'DOHException']
class DNSException(Exception):
@classmethod
def from_response(cls, response):
code = response['Status']
assert 1 <= code <= 9
ex... | true | true |
1c16f2233adb44646563c11592ac964f0033da02 | 3,803 | py | Python | app/routes/reset.py | AuFeld/COAG | 3874a9c1c6ceb908a6bbabfb49e2c701d8e54f20 | [
"MIT"
] | 1 | 2021-06-03T10:29:12.000Z | 2021-06-03T10:29:12.000Z | app/routes/reset.py | AuFeld/COAG | 3874a9c1c6ceb908a6bbabfb49e2c701d8e54f20 | [
"MIT"
] | 45 | 2021-06-05T14:47:09.000Z | 2022-03-30T06:16:44.000Z | app/routes/reset.py | AuFeld/COAG | 3874a9c1c6ceb908a6bbabfb49e2c701d8e54f20 | [
"MIT"
] | null | null | null | from typing import Callable, Optional
import jwt
from fastapi import APIRouter, Body, HTTPException, Request, status
from pydantic import UUID4, EmailStr
from app.models import users
from app.database.base_user import BaseUserDatabase
from app.users.password import get_password_hash
from app.common.user import ErrorC... | 37.284314 | 88 | 0.610834 | from typing import Callable, Optional
import jwt
from fastapi import APIRouter, Body, HTTPException, Request, status
from pydantic import UUID4, EmailStr
from app.models import users
from app.database.base_user import BaseUserDatabase
from app.users.password import get_password_hash
from app.common.user import ErrorC... | true | true |
1c16f2e311dc619581caef5d34598d167eb4afcd | 6,030 | py | Python | src/common/image_processor/feature_extractor/nucleus_diamiters.py | 0shimax/chainer-feedbacknet | 0a4660ca194ad2a1bd26f3b3728fa332b7a50811 | [
"MIT"
] | 3 | 2017-04-26T08:57:47.000Z | 2019-02-23T09:04:56.000Z | src/common/image_processor/feature_extractor/nucleus_diamiters.py | 0shimax/chainer-feedbacknet | 0a4660ca194ad2a1bd26f3b3728fa332b7a50811 | [
"MIT"
] | null | null | null | src/common/image_processor/feature_extractor/nucleus_diamiters.py | 0shimax/chainer-feedbacknet | 0a4660ca194ad2a1bd26f3b3728fa332b7a50811 | [
"MIT"
] | null | null | null | import sys, os
sys.path.append('./src/common/image_processor/feature_extractor')
import cv2
import numpy as np
import pandas as pd
from operator import itemgetter
from collections import defaultdict
from feature_extractor_utils import (show_image,
smooth_contour,
... | 37.924528 | 84 | 0.650249 | import sys, os
sys.path.append('./src/common/image_processor/feature_extractor')
import cv2
import numpy as np
import pandas as pd
from operator import itemgetter
from collections import defaultdict
from feature_extractor_utils import (show_image,
smooth_contour,
... | true | true |
1c16f2ed44bb5035ec17fb419b293c7b945f5ee6 | 331 | py | Python | accounts/migrations/0024_remove_mezun_ulke.py | eneskums/ogrenciBilgiSistemi | fca4eefff079fff3808010fa95713fe0c0bc4b8f | [
"MIT"
] | null | null | null | accounts/migrations/0024_remove_mezun_ulke.py | eneskums/ogrenciBilgiSistemi | fca4eefff079fff3808010fa95713fe0c0bc4b8f | [
"MIT"
] | null | null | null | accounts/migrations/0024_remove_mezun_ulke.py | eneskums/ogrenciBilgiSistemi | fca4eefff079fff3808010fa95713fe0c0bc4b8f | [
"MIT"
] | null | null | null | # Generated by Django 2.2.12 on 2020-05-10 11:35
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0023_remove_mezun_ogrencino'),
]
operations = [
migrations.RemoveField(
model_name='mezun',
name='ulke',
... | 18.388889 | 52 | 0.595166 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0023_remove_mezun_ogrencino'),
]
operations = [
migrations.RemoveField(
model_name='mezun',
name='ulke',
),
]
| true | true |
1c16f3022da28adc1ffcf9c2bf09f6440fc54b32 | 1,525 | py | Python | dist-packages/ibus/__init__.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | dist-packages/ibus/__init__.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | dist-packages/ibus/__init__.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | # vim:set et sts=4 sw=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2007-2010 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Sof... | 31.122449 | 75 | 0.763934 |
import warnings
warnings.warn("The ibus module is deprecated; "
"Please use gobject-introspection instead", DeprecationWarning)
from object import *
from attribute import *
from property import *
from common import *
from interface import *
from exception import *
from lookuptable import *
from bus import *
from ... | true | true |
1c16f31ff5c04eb0b6c4047db4baf78d7ef19b2f | 730 | py | Python | lib/python2.7/site-packages/django_filters/__init__.py | danielmicaletti/ride_cell | 910be09ebc714b8c744edaf81559c8a9266473e3 | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/django_filters/__init__.py | danielmicaletti/ride_cell | 910be09ebc714b8c744edaf81559c8a9266473e3 | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/django_filters/__init__.py | danielmicaletti/ride_cell | 910be09ebc714b8c744edaf81559c8a9266473e3 | [
"MIT"
] | null | null | null | # flake8: noqa
from __future__ import absolute_import
from .constants import STRICTNESS
from .filterset import FilterSet
from .filters import *
# We make the `rest_framework` module available without an additional import.
# If DRF is not installed we simply set None.
try:
from . import rest_framework
except Impo... | 22.121212 | 77 | 0.613699 | from __future__ import absolute_import
from .constants import STRICTNESS
from .filterset import FilterSet
from .filters import *
try:
from . import rest_framework
except ImportError:
rest_framework = None
__version__ = '1.0.2'
def parse_version(version):
v = version.split('.')
v = v[:-1] + v[-1].spl... | true | true |
1c16f389bb66b80fe96a4b258566acedb2740b67 | 1,082 | py | Python | location/utils.py | shivBoy77/Geo-Location | 1a39381209412dba9fc568f67d8bd3ac6069fd2a | [
"MIT"
] | 1 | 2021-07-28T09:40:43.000Z | 2021-07-28T09:40:43.000Z | location/utils.py | shivBoy77/Geo-Location | 1a39381209412dba9fc568f67d8bd3ac6069fd2a | [
"MIT"
] | null | null | null | location/utils.py | shivBoy77/Geo-Location | 1a39381209412dba9fc568f67d8bd3ac6069fd2a | [
"MIT"
] | null | null | null | # Helper
from typing import Counter
from django.contrib.gis.geoip2 import GeoIP2
def get_geo(ip):
g = GeoIP2()
country = g.country(ip)
city = g.city(ip)
lat, lon = g.lat_lon(ip)
return country, city, lat, lon
def get_center_coordinates(latA, longA, latB=None, longB=None):
cord ... | 23.521739 | 64 | 0.591497 | from typing import Counter
from django.contrib.gis.geoip2 import GeoIP2
def get_geo(ip):
g = GeoIP2()
country = g.country(ip)
city = g.city(ip)
lat, lon = g.lat_lon(ip)
return country, city, lat, lon
def get_center_coordinates(latA, longA, latB=None, longB=None):
cord = (latA, l... | true | true |
1c16f3d24d8a1938892c780f84dcb012cb41b2fe | 1,617 | py | Python | arviz/tests/test_diagnostics.py | AustinRochford/arviz | 5f202d9530abffc69dcc1b0d4bfc0dc34fe58e13 | [
"Apache-2.0"
] | null | null | null | arviz/tests/test_diagnostics.py | AustinRochford/arviz | 5f202d9530abffc69dcc1b0d4bfc0dc34fe58e13 | [
"Apache-2.0"
] | null | null | null | arviz/tests/test_diagnostics.py | AustinRochford/arviz | 5f202d9530abffc69dcc1b0d4bfc0dc34fe58e13 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from numpy.testing import assert_allclose
import pandas as pd
from ..stats import gelman_rubin, effective_n, geweke
class TestDiagnostics(object):
good_rhat = 1.1
def fake_trace(self, n_samples):
"""
Creates a fake trace with 3 variables and 2 chains
"""
al... | 34.404255 | 89 | 0.617192 | import numpy as np
from numpy.testing import assert_allclose
import pandas as pd
from ..stats import gelman_rubin, effective_n, geweke
class TestDiagnostics(object):
good_rhat = 1.1
def fake_trace(self, n_samples):
alpha = np.repeat((1, 5, 10), n_samples)
beta = np.repeat((1, 5, 1), n_sample... | true | true |
1c16f46450e5d28934bd4aaea21cebfaa816a363 | 3,092 | py | Python | render.py | Blazephoenix/manticore-beta | 5dcddb96dd7533d4f4d50b643d8bdcbff456b49c | [
"MIT"
] | 17 | 2020-04-19T16:22:22.000Z | 2020-09-17T13:43:43.000Z | render.py | Blazephoenix/manticore-beta | 5dcddb96dd7533d4f4d50b643d8bdcbff456b49c | [
"MIT"
] | null | null | null | render.py | Blazephoenix/manticore-beta | 5dcddb96dd7533d4f4d50b643d8bdcbff456b49c | [
"MIT"
] | null | null | null | import os
from pathlib import Path
from jinja2 import Environment, PackageLoader
from parse import Resume_parser, Post_parser
class Render:
"""
Renders the HTML page according to the arguments provided by build.py.
"""
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
env = Environment(... | 37.707317 | 101 | 0.552393 | import os
from pathlib import Path
from jinja2 import Environment, PackageLoader
from parse import Resume_parser, Post_parser
class Render:
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
env = Environment(loader=PackageLoader('render', 'templates'))
def Render_posts(self, posts):
POST... | true | true |
1c16f517a360d615a7b1ae71be14ad6ae1ed6bd8 | 18,976 | py | Python | plasticc/get_data.py | AzNOAOTares/plasticc | 03f8995673b6f09156783d35c7d63f34729d0610 | [
"MIT"
] | null | null | null | plasticc/get_data.py | AzNOAOTares/plasticc | 03f8995673b6f09156783d35c7d63f34729d0610 | [
"MIT"
] | null | null | null | plasticc/get_data.py | AzNOAOTares/plasticc | 03f8995673b6f09156783d35c7d63f34729d0610 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
Get PLASTICC data from SQL database
"""
import sys
import os
import numpy as np
import warnings
import argparse
import pandas as pd
import astropy.table as at
import astropy.io.fits as afits
from collections import OrderedDict
import database
import helpers
ROOT_DIR = os.getenv('PLASTICC_DI... | 42.357143 | 124 | 0.58516 | import sys
import os
import numpy as np
import warnings
import argparse
import pandas as pd
import astropy.table as at
import astropy.io.fits as afits
from collections import OrderedDict
import database
import helpers
ROOT_DIR = os.getenv('PLASTICC_DIR')
DATA_DIR = os.path.join(ROOT_DIR, 'plasticc_data')
def parse_g... | true | true |
1c16f581be52c15e072dcdfeb022c5ec072daa07 | 11,308 | py | Python | v6.0.6/firewall/fortios_firewall_ipv6_eh_filter.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 14 | 2018-09-25T20:35:25.000Z | 2021-07-14T04:30:54.000Z | v6.0.6/firewall/fortios_firewall_ipv6_eh_filter.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 32 | 2018-10-09T04:13:42.000Z | 2020-05-11T07:20:28.000Z | v6.0.6/firewall/fortios_firewall_ipv6_eh_filter.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 11 | 2018-10-09T00:14:53.000Z | 2021-11-03T10:54:09.000Z | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | 31.498607 | 119 | 0.588698 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: fortios_firewall_ipv6_eh_filter
short_description: Configu... | true | true |
1c16f5b4bcfeb33879d1bf073e4733bbf559651e | 278 | py | Python | dancertix/tests/test_performances.py | danizen/dancertix | 655b5ce65341ac3c3054f638f737c3db8b0b8bcc | [
"MIT"
] | null | null | null | dancertix/tests/test_performances.py | danizen/dancertix | 655b5ce65341ac3c3054f638f737c3db8b0b8bcc | [
"MIT"
] | 1 | 2020-11-23T19:50:52.000Z | 2020-11-23T19:50:52.000Z | dancertix/tests/test_performances.py | danizen/dancertix | 655b5ce65341ac3c3054f638f737c3db8b0b8bcc | [
"MIT"
] | null | null | null | from django.test import TestCase
from dancertix.models import Performance
class TestPerformances(TestCase):
def test_performances(self):
actual_count = Performance.objects.filter(venue__name='F. Scott Fitzgerald Theatre').count()
assert actual_count == 6
| 27.8 | 100 | 0.758993 | from django.test import TestCase
from dancertix.models import Performance
class TestPerformances(TestCase):
def test_performances(self):
actual_count = Performance.objects.filter(venue__name='F. Scott Fitzgerald Theatre').count()
assert actual_count == 6
| true | true |
1c16f5d3c05f0eeb3fb03da4b8fb67ffc7854c66 | 30,039 | py | Python | telemetry/telemetry/internal/platform/android_platform_backend.py | Scopetta197/catapult | 9cbc959a8a88460f71473794bdc92e39d6b3ee0d | [
"BSD-3-Clause"
] | null | null | null | telemetry/telemetry/internal/platform/android_platform_backend.py | Scopetta197/catapult | 9cbc959a8a88460f71473794bdc92e39d6b3ee0d | [
"BSD-3-Clause"
] | null | null | null | telemetry/telemetry/internal/platform/android_platform_backend.py | Scopetta197/catapult | 9cbc959a8a88460f71473794bdc92e39d6b3ee0d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import logging
import os
import posixpath
import re
import subprocess
import threading
import time
import six
from te... | 36.061224 | 114 | 0.701188 |
from __future__ import absolute_import
import logging
import os
import posixpath
import re
import subprocess
import threading
import time
import six
from telemetry.core import android_platform
from telemetry.core import exceptions
from telemetry.core import util
from telemetry import compat_mode_options
from telemetr... | true | true |
1c16f76130d943b0487ae9fbd79c4dafce046a9b | 3,546 | py | Python | orchestra/admin/menu.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | null | null | null | orchestra/admin/menu.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | 4 | 2021-01-30T14:26:46.000Z | 2022-03-18T16:28:39.000Z | orchestra/admin/menu.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | 3 | 2022-02-06T04:35:59.000Z | 2022-03-17T00:40:17.000Z | from copy import deepcopy
from admin_tools.menu import items, Menu
from django.urls import reverse
from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
from orchestra.core import services, accounts, administration
def api_link(context):
""" Dynamically generates API rel... | 35.108911 | 106 | 0.556966 | from copy import deepcopy
from admin_tools.menu import items, Menu
from django.urls import reverse
from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
from orchestra.core import services, accounts, administration
def api_link(context):
if 'opts' in context:
opt... | true | true |
1c16f7bc492a5339fc04c7b9d0b0923887a4db9c | 1,110 | py | Python | app/extensions/logger.py | OHS2020064/wechat-helper-server | 7740dc436a6b1281ae29224ee047e6ed8a8272c2 | [
"Apache-2.0"
] | null | null | null | app/extensions/logger.py | OHS2020064/wechat-helper-server | 7740dc436a6b1281ae29224ee047e6ed8a8272c2 | [
"Apache-2.0"
] | null | null | null | app/extensions/logger.py | OHS2020064/wechat-helper-server | 7740dc436a6b1281ae29224ee047e6ed8a8272c2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/6/17 15:50
# @Author : CoderCharm
# @File : logger.py
# @Software: PyCharm
# @Desc :
"""
日志文件配置
# 本来是想 像flask那样把日志对象挂载到app对象上,作者建议直接使用全局对象
https://github.com/tiangolo/fastapi/issues/81#issuecomment-473677039
"""
import os
import time
from loguru... | 20.181818 | 78 | 0.674775 |
import os
import time
from loguru import logger
env = os.getenv("INF_ENV", "")
if env:
basedir = os.path.dirname(os.path.dirname('/opt'))
else:
basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
log_path = os.path.join(basedir, 'logs')
if not os.path.exists(log_path):
os.mkdir(log_pat... | true | true |
1c16f8e1c22af9661c9b9a7fb2ac9e28c58c1d66 | 1,107 | py | Python | plaster/run/ims_import/ims_import_params.py | pymc-labs/plaster | 8535afd78d357c305aa522b30019b1039fa7caab | [
"MIT"
] | null | null | null | plaster/run/ims_import/ims_import_params.py | pymc-labs/plaster | 8535afd78d357c305aa522b30019b1039fa7caab | [
"MIT"
] | 22 | 2020-06-22T19:27:50.000Z | 2021-09-30T20:02:31.000Z | plaster/run/ims_import/ims_import_params.py | pymc-labs/plaster | 8535afd78d357c305aa522b30019b1039fa7caab | [
"MIT"
] | 2 | 2020-06-16T17:38:46.000Z | 2021-08-06T09:37:22.000Z | from munch import Munch
from plaster.tools.schema.schema import Schema as s, Params
class ImsImportParams(Params):
defaults = Munch(
is_movie=False,
start_field=0,
n_fields_limit=None,
start_cycle=0,
n_cycles_limit=None,
dst_ch_i_to_src_ch_i=None,
is_z_stack... | 32.558824 | 89 | 0.64318 | from munch import Munch
from plaster.tools.schema.schema import Schema as s, Params
class ImsImportParams(Params):
defaults = Munch(
is_movie=False,
start_field=0,
n_fields_limit=None,
start_cycle=0,
n_cycles_limit=None,
dst_ch_i_to_src_ch_i=None,
is_z_stack... | true | true |
1c16f96d3d643557793f8609ab342e4b9ba61332 | 5,735 | py | Python | elliot/recommender/latent_factor_models/FM/factorization_machine.py | deklanw/elliot | 729871d29093f63c3fe30d54bc42669fd16eb662 | [
"Apache-2.0"
] | null | null | null | elliot/recommender/latent_factor_models/FM/factorization_machine.py | deklanw/elliot | 729871d29093f63c3fe30d54bc42669fd16eb662 | [
"Apache-2.0"
] | null | null | null | elliot/recommender/latent_factor_models/FM/factorization_machine.py | deklanw/elliot | 729871d29093f63c3fe30d54bc42669fd16eb662 | [
"Apache-2.0"
] | null | null | null | """
Module description:
"""
__version__ = '0.1'
__author__ = 'Vito Walter Anelli, Claudio Pomo, Daniele Malitesta, Antonio Ferrara'
__email__ = 'vitowalter.anelli@poliba.it, claudio.pomo@poliba.it,' \
'daniele.malitesta@poliba.it, antonio.ferrara@poliba.it'
import pickle
import numpy as np
from tqdm im... | 39.280822 | 120 | 0.604359 |
__version__ = '0.1'
__author__ = 'Vito Walter Anelli, Claudio Pomo, Daniele Malitesta, Antonio Ferrara'
__email__ = 'vitowalter.anelli@poliba.it, claudio.pomo@poliba.it,' \
'daniele.malitesta@poliba.it, antonio.ferrara@poliba.it'
import pickle
import numpy as np
from tqdm import tqdm
from elliot.datase... | true | true |
1c16fa3a157c10da0d31eda2ccf3cc1f9aa6d265 | 4,221 | py | Python | reachee.py | TechCiel/Reachee | 1008d805c042699a3c7b83f618f7ab37a7207658 | [
"WTFPL"
] | 6 | 2020-06-30T06:33:07.000Z | 2021-12-06T01:45:58.000Z | reachee.py | TechCiel/Reachee | 1008d805c042699a3c7b83f618f7ab37a7207658 | [
"WTFPL"
] | 1 | 2020-06-30T06:34:57.000Z | 2021-07-25T11:26:39.000Z | reachee.py | TechCiel/Reachee | 1008d805c042699a3c7b83f618f7ab37a7207658 | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Please create reachee.json from reachee-example.json
or specifie config file in command line like
python3 reachee.py /path/to/config.json
'''
CONFIG = 'reachee.json'
import re
import json
import logging as log
from sys import argv
from time import sleep
from importl... | 28.910959 | 112 | 0.658375 |
CONFIG = 'reachee.json'
import re
import json
import logging as log
from sys import argv
from time import sleep
from importlib import import_module
import requests
import bs4
if len(argv)<2: argv.append(CONFIG)
c = {
'daemon': True,
'debug': False,
'interval': 300,
'channel': 179577,
'senders': {}
}
c.update(js... | true | true |
1c16fa40da8abe6d2825bdfd06c5cc65d980d3d2 | 321 | py | Python | molecule/default/tests/test_default.py | mongodb-ansible-roles/ansible-role-curator | 53f5288c7e0b0a34bf928c4bc92505344a7bfde3 | [
"Apache-2.0"
] | null | null | null | molecule/default/tests/test_default.py | mongodb-ansible-roles/ansible-role-curator | 53f5288c7e0b0a34bf928c4bc92505344a7bfde3 | [
"Apache-2.0"
] | 14 | 2019-08-16T18:56:45.000Z | 2020-02-27T17:22:58.000Z | molecule/default/tests/test_default.py | mongodb-ansible-roles/ansible-role-curator | 53f5288c7e0b0a34bf928c4bc92505344a7bfde3 | [
"Apache-2.0"
] | 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_curator(host):
assert host.file("/usr/local/bin/curator").exists
cmd = host.run("curator --version")
assert cmd.succeeded... | 21.4 | 63 | 0.750779 | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def test_curator(host):
assert host.file("/usr/local/bin/curator").exists
cmd = host.run("curator --version")
assert cmd.succeeded... | true | true |
1c16fadd8cdf461f2f5289c10d1818b88a701555 | 16,600 | py | Python | muttlib/forecast.py | alejandroviegener/copy-test | c9b32380ce85ec11488092d9f692c63ce51bd9eb | [
"Apache-2.0"
] | 22 | 2020-12-29T18:11:43.000Z | 2022-03-30T23:16:53.000Z | muttlib/forecast.py | alejandroviegener/copy-test | c9b32380ce85ec11488092d9f692c63ce51bd9eb | [
"Apache-2.0"
] | 3 | 2021-10-15T21:51:53.000Z | 2022-02-23T18:19:26.000Z | muttlib/forecast.py | alejandroviegener/copy-test | c9b32380ce85ec11488092d9f692c63ce51bd9eb | [
"Apache-2.0"
] | 1 | 2022-02-17T01:01:27.000Z | 2022-02-17T01:01:27.000Z | """Module to give FBProphet a common interface to Sklearn and general utilities
for forecasting problems like limiting the datasets to the last n days,
allowing wider grid search for hyperparameters not available using standard
FBProphet and Sklearn libraries.
Classes:
- SkProphet: a wrapper around FBProphet to prov... | 37.136465 | 105 | 0.613133 | from copy import deepcopy
from inspect import isclass, signature
import numpy as np
import pandas as pd
from fbprophet import Prophet
from sklearn.base import BaseEstimator
class SkProphet(Prophet):
DS = 'ds'
def __init__(
self,
sk_date_column=DS,
sk_yhat_only=True,
sk_extr... | true | true |
1c16fb1632bfa9ee472f8a6ae11bc6466b9ac1b8 | 26,543 | py | Python | tools/win/toolchain/toolchain.py | SlimKatLegacy/android_external_chromium_org | ee480ef5039d7c561fc66ccf52169ead186f1bea | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2015-03-04T02:36:53.000Z | 2016-06-25T11:22:17.000Z | tools/win/toolchain/toolchain.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/win/toolchain/toolchain.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 4 | 2015-02-09T08:49:30.000Z | 2017-08-26T02:03:34.000Z | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Extracts a Windows toolchain suitable for building Chrome from various
# downloadable pieces.
import ctypes
from optparse import OptionParser
import os
i... | 37.123077 | 80 | 0.696681 |
import ctypes
from optparse import OptionParser
import os
import shutil
import subprocess
import sys
import tempfile
import urllib2
g_temp_dirs = []
def GetLongPathName(path):
buf = ctypes.create_unicode_buffer(260)
size = ctypes.windll.kernel32.GetLongPathNameW(unicode(path), buf, 260)
if (size > 260):
... | true | true |
1c16fb6ddf36d09691adcedf211a746989d1cbde | 6,415 | py | Python | tests/test_005_benchmark.py | pastas/pastastore | 82eaf25ade96e1a09871390745b3cf441f8ef264 | [
"MIT"
] | 10 | 2020-03-25T12:17:17.000Z | 2022-01-26T10:45:13.000Z | tests/test_005_benchmark.py | webclinic017/pastastore | 82eaf25ade96e1a09871390745b3cf441f8ef264 | [
"MIT"
] | 27 | 2020-03-19T10:30:13.000Z | 2022-03-29T12:21:09.000Z | tests/test_005_benchmark.py | webclinic017/pastastore | 82eaf25ade96e1a09871390745b3cf441f8ef264 | [
"MIT"
] | 3 | 2020-03-18T14:39:35.000Z | 2021-06-21T14:30:53.000Z | import numpy as np
import pandas as pd
import pastastore as pst
import pytest
# %% write
# data
data = np.random.random_sample(int(1e5))
s = pd.Series(index=pd.date_range("1970", periods=1e5, freq="H"),
data=data)
metadata = {"x": 100000., "y": 300000.}
def series_write(conn):
conn.add_oseries(s, ... | 28.766816 | 76 | 0.679657 | import numpy as np
import pandas as pd
import pastastore as pst
import pytest
data = np.random.random_sample(int(1e5))
s = pd.Series(index=pd.date_range("1970", periods=1e5, freq="H"),
data=data)
metadata = {"x": 100000., "y": 300000.}
def series_write(conn):
conn.add_oseries(s, "oseries1", metada... | true | true |
1c16fb7b77b32183eee8aeaf30b0223eb2851c36 | 10,426 | py | Python | hubblestack/files/hubblestack_nova/openssl.py | brannondorsey/hubble | 12d07149201b9772f95abb8b735cdacd01c5aef6 | [
"Apache-2.0"
] | null | null | null | hubblestack/files/hubblestack_nova/openssl.py | brannondorsey/hubble | 12d07149201b9772f95abb8b735cdacd01c5aef6 | [
"Apache-2.0"
] | null | null | null | hubblestack/files/hubblestack_nova/openssl.py | brannondorsey/hubble | 12d07149201b9772f95abb8b735cdacd01c5aef6 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
'''
HubbleStack Nova module for auditing SSL certificates.
This audit module requires YAML data to execute. It will search the yaml data
received for the topkey 'openssl'.
Sample YAML data, with in line comments:
openssl:
google:
data:
tag: 'CERT-001' # require... | 37.103203 | 146 | 0.620084 |
from __future__ import absolute_import
import logging
import fnmatch
import copy
import salt.utils
import salt.utils.platform
import datetime
import time
import ssl
try:
import OpenSSL
_HAS_OPENSSL = True
except ImportError:
_HAS_OPENSSL = False
log = logging.getLogger(__name__)
__tags__ = None
__dat... | true | true |
1c16fbf44b1bbabd9b4e5f6e151501a8633091f0 | 275 | py | Python | keepalive.py | EarthlyEric/TYSH-News-WorkFlow | 75f31ba2d943661abbc33112a4a7b24f6d817a6a | [
"MIT"
] | null | null | null | keepalive.py | EarthlyEric/TYSH-News-WorkFlow | 75f31ba2d943661abbc33112a4a7b24f6d817a6a | [
"MIT"
] | 1 | 2021-10-19T08:06:16.000Z | 2021-10-19T08:06:16.000Z | keepalive.py | EarthlyEric/TYSH-News-WorkFlow | 75f31ba2d943661abbc33112a4a7b24f6d817a6a | [
"MIT"
] | null | null | null | from flask import Flask, render_template
from threading import Thread
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start() | 14.473684 | 40 | 0.665455 | from flask import Flask, render_template
from threading import Thread
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start() | true | true |
1c16fc7b2cd4a67240f6b17e1360303698f71b73 | 13,712 | py | Python | pegaflow/db/admin/commands.py | polyactis/pegaflow | d30d0bbb501ccfbe0ead6c950946a14d4b6c4708 | [
"Apache-2.0"
] | null | null | null | pegaflow/db/admin/commands.py | polyactis/pegaflow | d30d0bbb501ccfbe0ead6c950946a14d4b6c4708 | [
"Apache-2.0"
] | null | null | null | pegaflow/db/admin/commands.py | polyactis/pegaflow | d30d0bbb501ccfbe0ead6c950946a14d4b6c4708 | [
"Apache-2.0"
] | null | null | null | import logging
from pegaflow.command import CompoundCommand, LoggingCommand
from pegaflow.db import connection
from pegaflow.db.admin.admin_loader import *
from pegaflow.db.admin.versions import *
__author__ = "Rafael Ferreira da Silva"
log = logging.getLogger(__name__)
# -----------------------------------------... | 28.806723 | 106 | 0.534277 | import logging
from pegaflow.command import CompoundCommand, LoggingCommand
from pegaflow.db import connection
from pegaflow.db.admin.admin_loader import *
from pegaflow.db.admin.versions import *
__author__ = "Rafael Ferreira da Silva"
log = logging.getLogger(__name__)
class CreateCommand(LoggingCommand):
de... | true | true |
1c16fcad9d9f7e7a1140126e27fd81f8da7733bd | 3,325 | py | Python | methods/meta_template.py | PRIS-CV/BSNet | 993ce867aadc73aea33139751fd4454033cde9dd | [
"MIT"
] | 17 | 2020-12-15T13:29:49.000Z | 2022-03-16T03:20:40.000Z | methods/meta_template.py | spraise/BSNet | 993ce867aadc73aea33139751fd4454033cde9dd | [
"MIT"
] | null | null | null | methods/meta_template.py | spraise/BSNet | 993ce867aadc73aea33139751fd4454033cde9dd | [
"MIT"
] | 3 | 2020-12-15T13:30:17.000Z | 2022-03-23T07:09:22.000Z | import backbone
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import torch.nn.functional as F
import utils
from abc import abstractmethod
class MetaTemplate(nn.Module):
def __init__(self, model_func, n_way, n_support, change_way = True):
super(MetaTemplate, self)... | 32.920792 | 122 | 0.58015 | import backbone
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import torch.nn.functional as F
import utils
from abc import abstractmethod
class MetaTemplate(nn.Module):
def __init__(self, model_func, n_way, n_support, change_way = True):
super(MetaTemplate, self)... | true | true |
1c16fe371f6375622d729828fbb566301fca7996 | 124 | py | Python | dogecoinisawesome.py | dogecoinisawesome-dot-com/DogecoinIsAwesome.com | ff80b023cd77f387c4edc3f9fe5468f346a37c2d | [
"MIT"
] | 1 | 2021-05-30T20:08:58.000Z | 2021-05-30T20:08:58.000Z | dogecoinisawesome.py | dogecoinisawesome-dot-com/DogecoinIsAwesome.com | ff80b023cd77f387c4edc3f9fe5468f346a37c2d | [
"MIT"
] | 5 | 2021-05-05T13:26:10.000Z | 2022-02-27T11:13:20.000Z | dogecoinisawesome.py | dogecoinisawesome-dot-com/DogecoinIsAwesome.com | ff80b023cd77f387c4edc3f9fe5468f346a37c2d | [
"MIT"
] | null | null | null | from app import app
if __name__ == "__main__":
app.run(use_debugger=False, use_reloader=False, passthrough_errors=True) | 31 | 76 | 0.774194 | from app import app
if __name__ == "__main__":
app.run(use_debugger=False, use_reloader=False, passthrough_errors=True) | true | true |
1c16feceb4475df0acfaa5e232507e59611abe2d | 2,046 | py | Python | evogtk/gui/accessclasslib/checkbutton.py | R3v1L/evogtk | 9f951a08770e99ffd701a1994ba948aa8014f2af | [
"MIT"
] | null | null | null | evogtk/gui/accessclasslib/checkbutton.py | R3v1L/evogtk | 9f951a08770e99ffd701a1994ba948aa8014f2af | [
"MIT"
] | null | null | null | evogtk/gui/accessclasslib/checkbutton.py | R3v1L/evogtk | 9f951a08770e99ffd701a1994ba948aa8014f2af | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2008 EVO Sistemas Libres <central@evosistemas.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... | 35.275862 | 122 | 0.607038 |
import gtk
from evogtk.widgets import DBCheckButton
class AccessClass:
def supported_widgets(self):
return [gtk.CheckButton,gtk.ToggleButton,gtk.ToggleAction,gtk.ToggleToolButton,gtk.CheckMenuItem,gtk.ToggleAction,
gtk.RadioButton,gtk.RadioAction,gtk.RadioMenuItem,gtk.RadioToolBu... | true | true |
1c16ff451be4c14fd7d005730d08fe76a4b3d40e | 444 | py | Python | laboratorios/Lab-9/D/4_.py | Sforeelking/ayed-2019-1 | fda78d1c92ba4e8de74cc6db4f01e961676ba5a6 | [
"MIT"
] | null | null | null | laboratorios/Lab-9/D/4_.py | Sforeelking/ayed-2019-1 | fda78d1c92ba4e8de74cc6db4f01e961676ba5a6 | [
"MIT"
] | null | null | null | laboratorios/Lab-9/D/4_.py | Sforeelking/ayed-2019-1 | fda78d1c92ba4e8de74cc6db4f01e961676ba5a6 | [
"MIT"
] | null | null | null | from sys import stdin
def solve(a):
suma2=0
for x in range(len(a)):
suma=0
for elm in range(x):
suma= suma+ a[elm][0]
suma2+= (suma+ (a[x][0]- a[x][1]))
print(int(suma2/len(a)))
def main():
casos,n= int(stdin.readline().strip()),[]
for elm in range(casos):
... | 22.2 | 61 | 0.5 | from sys import stdin
def solve(a):
suma2=0
for x in range(len(a)):
suma=0
for elm in range(x):
suma= suma+ a[elm][0]
suma2+= (suma+ (a[x][0]- a[x][1]))
print(int(suma2/len(a)))
def main():
casos,n= int(stdin.readline().strip()),[]
for elm in range(casos):
... | true | true |
1c16ffda7ec683b945408a6e32a613a0ffd90d96 | 15,597 | py | Python | ibeis/init/main_helpers.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | ibeis/init/main_helpers.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | ibeis/init/main_helpers.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This module defines helper functions to access common input needed to test many
functions. These functions give a rich command line interface to specifically
select subsets of annotations, pipeline configurations, and other filters.
TODO: standardize function signatures
"""
from __future__ ... | 38.895262 | 139 | 0.643137 | from __future__ import absolute_import, division, print_function, unicode_literals
import utool as ut
import six from ibeis.init import old_main_helpers
(print, rrr, profile) = ut.inject2(__name__, '[main_helpers]')
get_test_daids = old_main_helpers.get_test_daids
get_test_qaids = old_main_helpers.get_test_qaids
VE... | true | true |
1c16ffff7493ea2ac6cd229e3a668e0866d581f5 | 1,910 | py | Python | tests/test_update.py | elisong/jparse | 1dd28f05c5bdc65ec8358b534fe0e2d739c36f09 | [
"Apache-2.0"
] | 1 | 2018-08-13T10:53:36.000Z | 2018-08-13T10:53:36.000Z | tests/test_update.py | elisong/jparse | 1dd28f05c5bdc65ec8358b534fe0e2d739c36f09 | [
"Apache-2.0"
] | null | null | null | tests/test_update.py | elisong/jparse | 1dd28f05c5bdc65ec8358b534fe0e2d739c36f09 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import OrderedDict
from jparse import JParser
jp = JParser()
TEST_CASE1 = [OrderedDict([('A1', 1), ('A2', 2), ('A3', 3)]),
OrderedDict([('A1', [4, 5, 6]), ('A2', 7), ('A3', 'x')])]
TEST_CASE2 = OrderedDict([('A1', [OrderedDict([('B1', 4), ('B2', 5)]),
... | 44.418605 | 82 | 0.428796 | from collections import OrderedDict
from jparse import JParser
jp = JParser()
TEST_CASE1 = [OrderedDict([('A1', 1), ('A2', 2), ('A3', 3)]),
OrderedDict([('A1', [4, 5, 6]), ('A2', 7), ('A3', 'x')])]
TEST_CASE2 = OrderedDict([('A1', [OrderedDict([('B1', 4), ('B2', 5)]),
Or... | true | true |
1c17004f3d946fc38888783c3387270a01775536 | 1,603 | py | Python | services/pushovernotifierservice/PushoverNotifierService.py | CydrickT/Namecheap-DDNS | e0ce6ee2ee79d48a2a03536d72c76d1daced0dc4 | [
"MIT"
] | null | null | null | services/pushovernotifierservice/PushoverNotifierService.py | CydrickT/Namecheap-DDNS | e0ce6ee2ee79d48a2a03536d72c76d1daced0dc4 | [
"MIT"
] | null | null | null | services/pushovernotifierservice/PushoverNotifierService.py | CydrickT/Namecheap-DDNS | e0ce6ee2ee79d48a2a03536d72c76d1daced0dc4 | [
"MIT"
] | null | null | null | import requests
from core.Service import Service
from topics.notification.Notification import Notification
from topics.notification.NotificationLevel import NotificationLevel
class PushoverNotifierService(Service):
def initialize(self):
self.core.dataRouter.subscribe(Notification, self.notify)
... | 36.431818 | 114 | 0.627573 | import requests
from core.Service import Service
from topics.notification.Notification import Notification
from topics.notification.NotificationLevel import NotificationLevel
class PushoverNotifierService(Service):
def initialize(self):
self.core.dataRouter.subscribe(Notification, self.notify)
... | true | true |
1c17007f51bb8d43b56afe9b012bf3dbad8f1be4 | 2,849 | py | Python | custom_components/hacs/repositories/python_script.py | sjabby/home-assistant-conf | 89f4bcea5daeddc1e657bc0d7f6db3197f6bddb8 | [
"MIT"
] | 3 | 2019-03-12T21:27:56.000Z | 2019-05-03T06:18:48.000Z | custom_components/hacs/repositories/python_script.py | sjabby/home-assistant-config | 89f4bcea5daeddc1e657bc0d7f6db3197f6bddb8 | [
"MIT"
] | null | null | null | custom_components/hacs/repositories/python_script.py | sjabby/home-assistant-config | 89f4bcea5daeddc1e657bc0d7f6db3197f6bddb8 | [
"MIT"
] | null | null | null | """Class for python_scripts in HACS."""
from custom_components.hacs.enums import HacsCategory
from custom_components.hacs.helpers.classes.exceptions import HacsException
from custom_components.hacs.helpers.classes.repository import HacsRepository
from custom_components.hacs.helpers.functions.information import find_fil... | 33.517647 | 91 | 0.618463 | from custom_components.hacs.enums import HacsCategory
from custom_components.hacs.helpers.classes.exceptions import HacsException
from custom_components.hacs.helpers.classes.repository import HacsRepository
from custom_components.hacs.helpers.functions.information import find_file_name
from custom_components.hacs.helpe... | true | true |
1c1700cabfd1f2c370c7237f6762b65782f2fbd1 | 7,824 | py | Python | tests/killer/test_process.py | adir-intsights/sergeant | 76229b045309a3d795ac760d9f08da04b5e0a750 | [
"MIT"
] | null | null | null | tests/killer/test_process.py | adir-intsights/sergeant | 76229b045309a3d795ac760d9f08da04b5e0a750 | [
"MIT"
] | null | null | null | tests/killer/test_process.py | adir-intsights/sergeant | 76229b045309a3d795ac760d9f08da04b5e0a750 | [
"MIT"
] | null | null | null | import multiprocessing
import os
import signal
import sys
import time
import unittest
import sergeant.killer.process
class KillerTestCase(
unittest.TestCase,
):
def setUp(
self,
):
self.sigint_fired = False
self.sigabrt_fired = False
signal.signal(
signalnum=s... | 22.54755 | 55 | 0.510481 | import multiprocessing
import os
import signal
import sys
import time
import unittest
import sergeant.killer.process
class KillerTestCase(
unittest.TestCase,
):
def setUp(
self,
):
self.sigint_fired = False
self.sigabrt_fired = False
signal.signal(
signalnum=s... | true | true |
1c170164addf1a2dec936f80cf27af22844854fa | 3,298 | py | Python | FRCScouting/TheBlueAlliance/migrations/0001_initial.py | xNovax/FRCScouting.ca | caf2774e5854a7386eceb21e57b68c1f9c1f7d2d | [
"MIT"
] | 1 | 2019-06-13T03:07:15.000Z | 2019-06-13T03:07:15.000Z | FRCScouting/TheBlueAlliance/migrations/0001_initial.py | xNovax/FRCScouting.ca | caf2774e5854a7386eceb21e57b68c1f9c1f7d2d | [
"MIT"
] | 8 | 2019-07-04T16:19:06.000Z | 2019-07-12T17:37:51.000Z | FRCScouting/TheBlueAlliance/migrations/0001_initial.py | xNovax/FRCScouting.ca | caf2774e5854a7386eceb21e57b68c1f9c1f7d2d | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2019-07-14 20:27
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='local_event',
fields=[
('address', models.T... | 45.805556 | 88 | 0.535779 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='local_event',
fields=[
('address', models.TextField(null=True)),
('city', m... | true | true |
1c1701ef066eed48e16a7909824b1791cc937cdf | 2,675 | py | Python | qa/rpc-tests/keypool.py | icocoinproject/icocoin | 0fbc434a848ef2d40c9a12438d2f148d947ed8f6 | [
"MIT"
] | 3 | 2018-03-31T00:15:04.000Z | 2018-04-30T03:56:16.000Z | qa/rpc-tests/keypool.py | icocoinproject/icocoin | 0fbc434a848ef2d40c9a12438d2f148d947ed8f6 | [
"MIT"
] | null | null | null | qa/rpc-tests/keypool.py | icocoinproject/icocoin | 0fbc434a848ef2d40c9a12438d2f148d947ed8f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Icocoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the wallet keypool, and interaction with wallet encryption/locking
# Add python-icocoinrpc to... | 34.74026 | 85 | 0.641121 |
from test_framework.test_framework import IcocoinTestFramework
from test_framework.util import *
class KeyPoolTest(IcocoinTestFramework):
def run_test(self):
nodes = self.nodes
nodes[0].encryptwallet('test')
icocoind_processes[0].wait()
nodes[0] = start_node(0, s... | true | true |
1c1701fdbcc4d8cca881c1feaf92d512c2609c1c | 753 | py | Python | examples/splitter.py | FigrHed/pymonome | 6c52ed75dec2304e3ba5f5cb15684458b68a0511 | [
"MIT"
] | null | null | null | examples/splitter.py | FigrHed/pymonome | 6c52ed75dec2304e3ba5f5cb15684458b68a0511 | [
"MIT"
] | null | null | null | examples/splitter.py | FigrHed/pymonome | 6c52ed75dec2304e3ba5f5cb15684458b68a0511 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import asyncio
import monome
from life import Life
if __name__ == '__main__':
loop = asyncio.get_event_loop()
section1 = monome.GridSection((8, 8), (0, 0))
section2 = monome.GridSection((8, 8), (8, 0))
splitter = monome.GridSplitter([section1, section2])
life1 = Life()
... | 24.290323 | 71 | 0.679947 |
import asyncio
import monome
from life import Life
if __name__ == '__main__':
loop = asyncio.get_event_loop()
section1 = monome.GridSection((8, 8), (0, 0))
section2 = monome.GridSection((8, 8), (8, 0))
splitter = monome.GridSplitter([section1, section2])
life1 = Life()
life1.set_grid(sectio... | true | true |
1c17022cf7a218a976633f70dd14647acf024f9d | 2,464 | py | Python | bigmler/tests/common_steps.py | jaor/bigmler | cd06940a3eac1f49ce9df36864dfd1882782be7e | [
"Apache-2.0"
] | null | null | null | bigmler/tests/common_steps.py | jaor/bigmler | cd06940a3eac1f49ce9df36864dfd1882782be7e | [
"Apache-2.0"
] | null | null | null | bigmler/tests/common_steps.py | jaor/bigmler | cd06940a3eac1f49ce9df36864dfd1882782be7e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2014-2022 BigML
#
# 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 ... | 29.686747 | 76 | 0.648539 |
import os
from bigmler.tests.world import world
from bigmler.utils import BIGML_SYS_ENCODING
from bigml.api import HTTP_OK, HTTP_UNAUTHORIZED
def check_debug(command, project=True):
non_project_commands = ["--project", "bigmler reify", "bigmler analyze",
"bigmler delete", "bigmler ... | true | true |
1c170322ec90639308d4d98ec4363a8e12e56336 | 12,063 | py | Python | grizzly_extras/async_message/mq.py | boffman/grizzly | eabe7b8f6cd7098914a1473928135c1e05758af7 | [
"MIT"
] | null | null | null | grizzly_extras/async_message/mq.py | boffman/grizzly | eabe7b8f6cd7098914a1473928135c1e05758af7 | [
"MIT"
] | null | null | null | grizzly_extras/async_message/mq.py | boffman/grizzly | eabe7b8f6cd7098914a1473928135c1e05758af7 | [
"MIT"
] | null | null | null | from typing import Optional, Generator, Dict, cast
from time import monotonic as time, sleep
from contextlib import contextmanager
from ..transformer import transformer, TransformerError, TransformerContentType
from ..arguments import parse_arguments, get_unsupported_arguments
from . import (
AsyncMessageRequest... | 40.21 | 152 | 0.578214 | from typing import Optional, Generator, Dict, cast
from time import monotonic as time, sleep
from contextlib import contextmanager
from ..transformer import transformer, TransformerError, TransformerContentType
from ..arguments import parse_arguments, get_unsupported_arguments
from . import (
AsyncMessageRequest... | true | true |
1c17035928116de521275dcf64cfa79643041974 | 547 | py | Python | app/main.py | monomonosu/SoundHornet | 26d269c623821e34375c5d764b7f790621336fae | [
"MIT"
] | null | null | null | app/main.py | monomonosu/SoundHornet | 26d269c623821e34375c5d764b7f790621336fae | [
"MIT"
] | null | null | null | app/main.py | monomonosu/SoundHornet | 26d269c623821e34375c5d764b7f790621336fae | [
"MIT"
] | null | null | null | from flask import jsonify,render_template
from models import *
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def index(path):
return render_template('index.html')
@app.route('/hoge-page', defaults={'path': ''})
@app.route('/<path:path>')
def hogePage(path):
return render_template('hoge.h... | 21.88 | 55 | 0.659963 | from flask import jsonify,render_template
from models import *
@app.route('/', defaults={'path': ''})
@app.route('/<path:path>')
def index(path):
return render_template('index.html')
@app.route('/hoge-page', defaults={'path': ''})
@app.route('/<path:path>')
def hogePage(path):
return render_template('hoge.h... | true | true |
1c1703f16626b3f6015818fca8198b9282a9e8a8 | 3,663 | py | Python | audio.py | sveinbjornt/ensk.is | 2c6c0bff62a62c1fbf0c17d5b7a561b9e36e5539 | [
"BSD-3-Clause"
] | 15 | 2022-03-15T21:24:47.000Z | 2022-03-28T19:03:48.000Z | audio.py | sveinbjornt/ensk.is | 2c6c0bff62a62c1fbf0c17d5b7a561b9e36e5539 | [
"BSD-3-Clause"
] | 4 | 2022-03-20T08:34:50.000Z | 2022-03-24T14:39:30.000Z | audio.py | sveinbjornt/ensk.is | 2c6c0bff62a62c1fbf0c17d5b7a561b9e36e5539 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
"""
Ensk.is - Free and open English-Icelandic dictionary
Copyright (c) 2022, Sveinbjorn Thordarson <sveinbjorn@sveinbjorn.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following con... | 33.605505 | 86 | 0.706525 |
from typing import Optional
import os
import subprocess
from os.path import exists
from util import read_all_words
_SPEECHSYNTH_CLT = "/usr/bin/say"
def synthesize_word(w: str, dest_folder=None, voice="Daniel") -> Optional[str]:
assert dest_folder is not None
assert voice in ["Daniel", "Alex"]
sub... | true | true |
1c170421ffcc7496a7983bdb9e34e48baf001301 | 1,394 | py | Python | Product2/Price_tags_photos/White_new_5classes_ (176 items)/.virtual_documents/script_xml_to_csv.ipynb.py | strateg17/SMART_DS_Academy_Prod2 | 6d807e1468a9769399bfcaeeabebbee76ee1fdbd | [
"Apache-2.0"
] | null | null | null | Product2/Price_tags_photos/White_new_5classes_ (176 items)/.virtual_documents/script_xml_to_csv.ipynb.py | strateg17/SMART_DS_Academy_Prod2 | 6d807e1468a9769399bfcaeeabebbee76ee1fdbd | [
"Apache-2.0"
] | null | null | null | Product2/Price_tags_photos/White_new_5classes_ (176 items)/.virtual_documents/script_xml_to_csv.ipynb.py | strateg17/SMART_DS_Academy_Prod2 | 6d807e1468a9769399bfcaeeabebbee76ee1fdbd | [
"Apache-2.0"
] | null | null | null | import os
import shutil
import zipfile
import urllib
import xml.etree.ElementTree as ET
import numpy as np
import csv
import pandas
# all files: jpeg and xml are in the same folder
os.listdir()
# Define the necessary variables
DATASET_DIR = 'test'
ANNOTATIONS_FILE = 'annotations_test.csv'
CLASSES_FILE = 'classes_te... | 20.80597 | 75 | 0.6033 | import os
import shutil
import zipfile
import urllib
import xml.etree.ElementTree as ET
import numpy as np
import csv
import pandas
os.listdir()
DATASET_DIR = 'test'
ANNOTATIONS_FILE = 'annotations_test.csv'
CLASSES_FILE = 'classes_test.csv'
annotations = []
classes = set([])
for xml_file in [f for f in os.listd... | true | true |
1c17057e8e624204272179483c5e12546c7312ad | 13,070 | py | Python | debian/python-nova/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/admin_actions.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | null | null | null | debian/python-nova/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/admin_actions.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | null | null | null | debian/python-nova/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/contrib/admin_actions.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | 1 | 2020-07-24T08:31:57.000Z | 2020-07-24T08:31:57.000Z | # Copyright 2011 OpenStack, 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... | 38.89881 | 79 | 0.632364 |
import os.path
import traceback
import webob
from webob import exc
from nova.api.openstack import common
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
from nova.compute import vm_states
from nova import exception
from nova import flags
from nova.openstack.comm... | false | true |
1c1706eebb4d2de68a41095642186990a358bf21 | 2,987 | py | Python | elements/latex.py | partha-ghosh/pyeffects | b941e9b09c9889c01b103d758707d36c3520de2a | [
"MIT"
] | null | null | null | elements/latex.py | partha-ghosh/pyeffects | b941e9b09c9889c01b103d758707d36c3520de2a | [
"MIT"
] | null | null | null | elements/latex.py | partha-ghosh/pyeffects | b941e9b09c9889c01b103d758707d36c3520de2a | [
"MIT"
] | null | null | null | import hashlib
import os
import bs4
import numpy as np
from .group import Group
from .path import Path
from .shapes import Rectangle
class TexConfig:
main_font = None
mono_font = None
sans_font = None
margin = 5.5
scale_factor = 8
fill = [255, 255, 255]
stroke = [255, 255, 255]
strok... | 35.559524 | 155 | 0.611316 | import hashlib
import os
import bs4
import numpy as np
from .group import Group
from .path import Path
from .shapes import Rectangle
class TexConfig:
main_font = None
mono_font = None
sans_font = None
margin = 5.5
scale_factor = 8
fill = [255, 255, 255]
stroke = [255, 255, 255]
strok... | true | true |
1c17076bcdbc113d48535eaffcc01c299722ff44 | 519 | py | Python | metagov/metagov/plugins/discord/migrations/0001_initial.py | ajnam12/gateway | 8e2265820687ff8091eeb43643df80e88d470fe4 | [
"MIT"
] | 8 | 2021-11-18T18:26:04.000Z | 2022-02-28T20:07:56.000Z | metagov/metagov/plugins/discord/migrations/0001_initial.py | ajnam12/gateway | 8e2265820687ff8091eeb43643df80e88d470fe4 | [
"MIT"
] | 38 | 2021-11-17T14:25:21.000Z | 2022-03-28T20:38:47.000Z | metagov/metagov/plugins/discord/migrations/0001_initial.py | ajnam12/gateway | 8e2265820687ff8091eeb43643df80e88d470fe4 | [
"MIT"
] | 2 | 2021-12-22T02:27:24.000Z | 2022-01-18T02:45:14.000Z | # Generated by Django 3.2.2 on 2021-12-09 20:04
from django.db import migrations
class Migration(migrations.Migration):
initial = True
dependencies = [
('core', '0006_auto_20211101_2053'),
]
operations = [
migrations.CreateModel(
name='Discord',
fields=[
... | 19.222222 | 47 | 0.466281 |
from django.db import migrations
class Migration(migrations.Migration):
initial = True
dependencies = [
('core', '0006_auto_20211101_2053'),
]
operations = [
migrations.CreateModel(
name='Discord',
fields=[
],
options={
... | true | true |
1c1707f9c6f6ad2538dfbb091a4d961724717742 | 434 | py | Python | ecommerce/baskets/migrations/0005_alter_basket_slug.py | Gundwane21/bootcamp | a3df329736ce50058c05592d484aa59412fe8ea9 | [
"MIT"
] | 16 | 2021-11-25T11:06:06.000Z | 2022-01-31T06:36:18.000Z | ecommerce/baskets/migrations/0005_alter_basket_slug.py | Gundwane21/bootcamp | a3df329736ce50058c05592d484aa59412fe8ea9 | [
"MIT"
] | 19 | 2021-11-23T21:49:08.000Z | 2022-01-08T12:40:04.000Z | ecommerce/baskets/migrations/0005_alter_basket_slug.py | Gundwane21/bootcamp | a3df329736ce50058c05592d484aa59412fe8ea9 | [
"MIT"
] | 60 | 2021-11-21T08:32:10.000Z | 2021-12-12T17:36:19.000Z | # Generated by Django 3.2.9 on 2021-12-23 18:41
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("baskets", "0004_auto_20211223_2136"),
]
operations = [
migrations.AlterField(
model_name="basket",
name... | 20.666667 | 87 | 0.619816 |
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("baskets", "0004_auto_20211223_2136"),
]
operations = [
migrations.AlterField(
model_name="basket",
name="slug",
field=models.UUIDField(auto... | true | true |
1c17089ae48b68c069b28b1fcdc221aeef00d4e1 | 85 | py | Python | mlopt/__init__.py | arnaudvl/ml-parameter-optimization | 7330ba9bfd3082e8e2ffc34623288757720a0be8 | [
"MIT"
] | 23 | 2018-12-08T16:46:35.000Z | 2021-12-24T13:02:37.000Z | mlopt/__init__.py | WajdiBenSaad/ml-parameter-optimization | 8d57bccd56c637de8871ed6bd9ab790b2cee4a08 | [
"MIT"
] | 2 | 2020-05-01T09:25:38.000Z | 2020-05-19T06:51:46.000Z | mlopt/__init__.py | WajdiBenSaad/ml-parameter-optimization | 8d57bccd56c637de8871ed6bd9ab790b2cee4a08 | [
"MIT"
] | 7 | 2018-12-08T16:46:39.000Z | 2020-11-27T08:43:21.000Z | __all__ = ['lgb_tune', 'ml_tune', 'sklearn_tune', 'xgb_tune']
__version__ = '1.0.1'
| 21.25 | 61 | 0.658824 | __all__ = ['lgb_tune', 'ml_tune', 'sklearn_tune', 'xgb_tune']
__version__ = '1.0.1'
| true | true |
1c1709012c8cfe46a9b705fa2109af20247ba53c | 301 | py | Python | api/modules/binarytree/treetojson.py | JanezSedeljsak/vsae | 14fe13206e0ba48805e751a613f3acea931ac1ba | [
"CC0-1.0"
] | 1 | 2020-04-03T05:43:07.000Z | 2020-04-03T05:43:07.000Z | api/modules/binarytree/treetojson.py | JanezSedeljsak/vsae | 14fe13206e0ba48805e751a613f3acea931ac1ba | [
"CC0-1.0"
] | 15 | 2020-03-24T18:12:05.000Z | 2022-03-12T00:20:59.000Z | api/modules/binarytree/treetojson.py | JanezSedeljsak/vsae | 14fe13206e0ba48805e751a613f3acea931ac1ba | [
"CC0-1.0"
] | null | null | null | from api.modules.binarytree.node import Index as Node
Index = lambda expTree : {
'value': expTree.data,
'left': Index(expTree.left) if expTree.left else None,
'right': Index(expTree.right) if expTree.right else None,
'ident': f'{expTree.ident}',
'color': expTree.color or False
} | 33.444444 | 61 | 0.684385 | from api.modules.binarytree.node import Index as Node
Index = lambda expTree : {
'value': expTree.data,
'left': Index(expTree.left) if expTree.left else None,
'right': Index(expTree.right) if expTree.right else None,
'ident': f'{expTree.ident}',
'color': expTree.color or False
} | true | true |
1c17091c3c18bb08be8c834ebc10b8483b6fe96d | 245 | py | Python | NFSP/workers/chief/dist.py | rgg81/Neural-Fictitous-Self-Play | 8592890e4c87f323f5501cef31ca70590972e4b7 | [
"MIT"
] | 78 | 2020-06-21T09:45:39.000Z | 2022-03-28T11:39:38.000Z | NFSP/workers/chief/dist.py | jsanderink/tue | 4462845f159554b9a9812e3af43d07c2b5cd2059 | [
"MIT"
] | 5 | 2020-06-26T05:21:57.000Z | 2021-04-11T11:03:27.000Z | NFSP/workers/chief/dist.py | jsanderink/tue | 4462845f159554b9a9812e3af43d07c2b5cd2059 | [
"MIT"
] | 18 | 2020-06-22T16:05:57.000Z | 2021-11-13T07:29:34.000Z | # Copyright (c) 2019 Eric Steinberger
import ray
from NFSP.workers.chief.local import Chief as _LocalChief
@ray.remote(num_cpus=1)
class Chief(_LocalChief):
def __init__(self, t_prof):
_LocalChief.__init__(self, t_prof=t_prof)
| 17.5 | 57 | 0.742857 |
import ray
from NFSP.workers.chief.local import Chief as _LocalChief
@ray.remote(num_cpus=1)
class Chief(_LocalChief):
def __init__(self, t_prof):
_LocalChief.__init__(self, t_prof=t_prof)
| true | true |
1c1709a4f94f9b7fc1deac20411286869a36b16c | 4,344 | py | Python | ogb/graphproppred/make_master_file.py | BU-Lisp/ogb | 882786c0b71f5c836275c03b8554ad919bfe34e4 | [
"MIT"
] | 2 | 2021-06-22T20:10:14.000Z | 2021-12-03T11:38:01.000Z | ogb/graphproppred/make_master_file.py | zdqf/ogb | 1d6dde8080261931bc6ce2491e9149298af1ea98 | [
"MIT"
] | null | null | null | ogb/graphproppred/make_master_file.py | zdqf/ogb | 1d6dde8080261931bc6ce2491e9149298af1ea98 | [
"MIT"
] | 1 | 2021-12-02T08:50:04.000Z | 2021-12-02T08:50:04.000Z | ### script for writing meta information of datasets into master.csv
### for graph property prediction datasets.
import pandas as pd
dataset_list = []
dataset_dict = {}
### start molecule dataset
dataset_dict['ogbg-molbace'] = {'num tasks': 1, 'eval metric': 'rocauc', 'download_name': 'bace'}
dataset_dict['ogbg-molbbb... | 48.266667 | 131 | 0.70442 | import pandas as pd
dataset_list = []
dataset_dict = {}
dataset_dict['ogbg-molbace'] = {'num tasks': 1, 'eval metric': 'rocauc', 'download_name': 'bace'}
dataset_dict['ogbg-molbbbp'] = {'num tasks': 1, 'eval metric': 'rocauc', 'download_name': 'bbbp'}
dataset_dict['ogbg-molclintox'] = {'num tasks': 2, 'eval metric': ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.